tags 521749 patch
thanks

Hi,

Attached is a patch including defines for PAGE_{MASK,SHIFT,SIZE} which were
previously available in asm/page.h (BTS #479898).

Tested with an Agere Systems WinModem 56k [11c1:0449] (rev 01).

Geoff
only in patch2:
unchanged:
--- martian-modem-20080617.orig/modem/tweakrelocsdynamic.c
+++ martian-modem-20080617/modem/tweakrelocsdynamic.c
@@ -24,7 +24,9 @@
 #include <unistd.h>
 #include <fcntl.h>
 
-#include <asm/page.h>
+// #include <asm/page.h>
+#define PAGE_SIZE (sysconf(_SC_PAGESIZE))
+#define PAGE_MASK (~(sysconf(_SC_PAGESIZE) - 1))
 
 #define PREFIX "dynreloc"
 #include "log.h"
only in patch2:
unchanged:
--- martian-modem-20080617.orig/modem/mport.c
+++ martian-modem-20080617/modem/mport.c
@@ -5,7 +5,7 @@
 #include <sys/ioctl.h>
 #include <sys/mman.h>		/*** mmap */
 // #include <limits.h>
-#include <asm/page.h>		/*** PAGE_SIZE */
+// #include <asm/page.h>		/*** PAGE_SIZE */
 #include <string.h>		/*** memcmp */
 #include <sys/io.h>
 #include <unistd.h>		// close
@@ -27,6 +27,8 @@
 #include "../martian.h"
 
 #define MSIGVI (SIGRTMIN + 1)
+#define PAGE_SIZE (sysconf(_SC_PAGESIZE))
+#define PAGE_SHIFT (ffs(sysconf(_SC_PAGESIZE)) - 1)
 
 extern int pin_thread (void);
 extern int smp_setup (int irq, int dev_fd);

Reply via email to