···121121}122122123123#define PG_dcache_dirty PG_arch_1124124+#define PG_dcache_cpu_shift 24125125+#define PG_dcache_cpu_mask (256 - 1)126126+127127+#if NR_CPUS > 256128128+#error D-cache dirty tracking and thread_info->cpu need fixing for > 256 cpus129129+#endif124130125131#define dcache_dirty_cpu(page) \126126- (((page)->flags >> 24) & (NR_CPUS - 1UL))132132+ (((page)->flags >> PG_dcache_cpu_shift) & PG_dcache_cpu_mask)127133128134static __inline__ void set_dcache_dirty(struct page *page, int this_cpu)129135{130136 unsigned long mask = this_cpu;131131- unsigned long non_cpu_bits = ~((NR_CPUS - 1UL) << 24UL);132132- mask = (mask << 24) | (1UL << PG_dcache_dirty);137137+ unsigned long non_cpu_bits;138138+139139+ non_cpu_bits = ~(PG_dcache_cpu_mask << PG_dcache_cpu_shift);140140+ mask = (mask << PG_dcache_cpu_shift) | (1UL << PG_dcache_dirty);141141+133142 __asm__ __volatile__("1:\n\t"134143 "ldx [%2], %%g7\n\t"135144 "and %%g7, %1, %%g1\n\t"···160151 __asm__ __volatile__("! test_and_clear_dcache_dirty\n"161152 "1:\n\t"162153 "ldx [%2], %%g7\n\t"163163- "srlx %%g7, 24, %%g1\n\t"154154+ "srlx %%g7, %4, %%g1\n\t"164155 "and %%g1, %3, %%g1\n\t"165156 "cmp %%g1, %0\n\t"166157 "bne,pn %%icc, 2f\n\t"···173164 "2:"174165 : /* no outputs */175166 : "r" (cpu), "r" (mask), "r" (&page->flags),176176- "i" (NR_CPUS - 1UL)167167+ "i" (PG_dcache_cpu_mask),168168+ "i" (PG_dcache_cpu_shift)177169 : "g1", "g7");178170}179171···190180 if (pfn_valid(pfn) &&191181 (page = pfn_to_page(pfn), page_mapping(page)) &&192182 ((pg_flags = page->flags) & (1UL << PG_dcache_dirty))) {193193- int cpu = ((pg_flags >> 24) & (NR_CPUS - 1UL));183183+ int cpu = ((pg_flags >> PG_dcache_cpu_shift) &184184+ PG_dcache_cpu_mask);194185 int this_cpu = get_cpu();195186196187 /* This is just to optimize away some function calls
+3-3
include/asm-sparc/unistd.h
···167167#define __NR_pciconfig_read 148 /* ENOSYS under SunOS */168168#define __NR_pciconfig_write 149 /* ENOSYS under SunOS */169169#define __NR_getsockname 150 /* Common */170170-/* #define __NR_getmsg 151 SunOS Specific */171171-/* #define __NR_putmsg 152 SunOS Specific */170170+#define __NR_inotify_init 151 /* Linux specific */171171+#define __NR_inotify_add_watch 152 /* Linux specific */172172#define __NR_poll 153 /* Common */173173#define __NR_getdents64 154 /* Linux specific */174174#define __NR_fcntl64 155 /* Linux sparc32 Specific */175175-/* #define __NR_getdirentires 156 SunOS Specific */175175+#define __NR_inotify_rm_watch 156 /* Linux specific */176176#define __NR_statfs 157 /* Common */177177#define __NR_fstatfs 158 /* Common */178178#define __NR_umount 159 /* Common */
+3-3
include/asm-sparc64/unistd.h
···167167#define __NR_pciconfig_read 148 /* ENOSYS under SunOS */168168#define __NR_pciconfig_write 149 /* ENOSYS under SunOS */169169#define __NR_getsockname 150 /* Common */170170-/* #define __NR_getmsg 151 SunOS Specific */171171-/* #define __NR_putmsg 152 SunOS Specific */170170+#define __NR_inotify_init 151 /* Linux specific */171171+#define __NR_inotify_add_watch 152 /* Linux specific */172172#define __NR_poll 153 /* Common */173173#define __NR_getdents64 154 /* Linux specific */174174/* #define __NR_fcntl64 155 Linux sparc32 Specific */175175-/* #define __NR_getdirentries 156 SunOS Specific */175175+#define __NR_inotify_rm_watch 156 /* Linux specific */176176#define __NR_statfs 157 /* Common */177177#define __NR_fstatfs 158 /* Common */178178#define __NR_umount 159 /* Common */