Skip to content

Commit e261550

Browse files
committed
Merge branch 'kmap-atomic' of https://github.com/tsahee/LiME into tsahee-kmap-atomic
2 parents a19344f + 6be14ee commit e261550

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/lime.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@
7676
#define LIME_SUPPORTS_TIMING
7777
#endif
7878

79+
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
80+
#define LIME_USE_KMAP_ATOMIC
81+
#endif
82+
7983
#ifdef CONFIG_ZLIB_DEFLATE
8084
#define LIME_SUPPORTS_DEFLATE
8185
#endif

src/main.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,12 @@ static void write_range(struct resource * res) {
288288
DBG("Padding partial page: vaddr %p size: %lu", (void *) i, (unsigned long) is);
289289
write_padding(is);
290290
} else {
291+
#ifdef LIME_USE_KMAP_ATOMIC
292+
v = kmap_atomic(p);
293+
copy_page(vpage, v);
294+
kunmap_atomic(v);
295+
s = write_vaddr(vpage, is);
296+
#else
291297
v = kmap(p);
292298
/*
293299
* If we need to compute the digest or compress the output
@@ -300,6 +306,7 @@ static void write_range(struct resource * res) {
300306
s = write_vaddr(v, is);
301307
}
302308
kunmap(p);
309+
#endif
303310

304311
if (s < 0) {
305312
DBG("Failed to write page: vaddr %p. Skipping Range...", v);

0 commit comments

Comments
 (0)