diff options
Diffstat (limited to 'include/asm-x86_64')
-rw-r--r-- | include/asm-x86_64/atomic.h | 1 | ||||
-rw-r--r-- | include/asm-x86_64/bitops.h | 27 | ||||
-rw-r--r-- | include/asm-x86_64/cacheflush.h | 4 | ||||
-rw-r--r-- | include/asm-x86_64/mman.h | 1 | ||||
-rw-r--r-- | include/asm-x86_64/mpspec.h | 2 | ||||
-rw-r--r-- | include/asm-x86_64/pgtable.h | 2 | ||||
-rw-r--r-- | include/asm-x86_64/system.h | 2 |
7 files changed, 38 insertions, 1 deletions
diff --git a/include/asm-x86_64/atomic.h b/include/asm-x86_64/atomic.h index 50db9f39274f..72eb071488c7 100644 --- a/include/asm-x86_64/atomic.h +++ b/include/asm-x86_64/atomic.h | |||
@@ -424,4 +424,5 @@ __asm__ __volatile__(LOCK "orl %0,%1" \ | |||
424 | #define smp_mb__before_atomic_inc() barrier() | 424 | #define smp_mb__before_atomic_inc() barrier() |
425 | #define smp_mb__after_atomic_inc() barrier() | 425 | #define smp_mb__after_atomic_inc() barrier() |
426 | 426 | ||
427 | #include <asm-generic/atomic.h> | ||
427 | #endif | 428 | #endif |
diff --git a/include/asm-x86_64/bitops.h b/include/asm-x86_64/bitops.h index 05a0d374404b..a4d5d0909453 100644 --- a/include/asm-x86_64/bitops.h +++ b/include/asm-x86_64/bitops.h | |||
@@ -340,6 +340,20 @@ static __inline__ unsigned long __ffs(unsigned long word) | |||
340 | return word; | 340 | return word; |
341 | } | 341 | } |
342 | 342 | ||
343 | /* | ||
344 | * __fls: find last bit set. | ||
345 | * @word: The word to search | ||
346 | * | ||
347 | * Undefined if no zero exists, so code should check against ~0UL first. | ||
348 | */ | ||
349 | static __inline__ unsigned long __fls(unsigned long word) | ||
350 | { | ||
351 | __asm__("bsrq %1,%0" | ||
352 | :"=r" (word) | ||
353 | :"rm" (word)); | ||
354 | return word; | ||
355 | } | ||
356 | |||
343 | #ifdef __KERNEL__ | 357 | #ifdef __KERNEL__ |
344 | 358 | ||
345 | static inline int sched_find_first_bit(const unsigned long *b) | 359 | static inline int sched_find_first_bit(const unsigned long *b) |
@@ -370,6 +384,19 @@ static __inline__ int ffs(int x) | |||
370 | } | 384 | } |
371 | 385 | ||
372 | /** | 386 | /** |
387 | * fls64 - find last bit set in 64 bit word | ||
388 | * @x: the word to search | ||
389 | * | ||
390 | * This is defined the same way as fls. | ||
391 | */ | ||
392 | static __inline__ int fls64(__u64 x) | ||
393 | { | ||
394 | if (x == 0) | ||
395 | return 0; | ||
396 | return __fls(x) + 1; | ||
397 | } | ||
398 | |||
399 | /** | ||
373 | * hweightN - returns the hamming weight of a N-bit word | 400 | * hweightN - returns the hamming weight of a N-bit word |
374 | * @x: the word to weigh | 401 | * @x: the word to weigh |
375 | * | 402 | * |
diff --git a/include/asm-x86_64/cacheflush.h b/include/asm-x86_64/cacheflush.h index b3189fb229d1..d32f7f58752a 100644 --- a/include/asm-x86_64/cacheflush.h +++ b/include/asm-x86_64/cacheflush.h | |||
@@ -27,4 +27,8 @@ void global_flush_tlb(void); | |||
27 | int change_page_attr(struct page *page, int numpages, pgprot_t prot); | 27 | int change_page_attr(struct page *page, int numpages, pgprot_t prot); |
28 | int change_page_attr_addr(unsigned long addr, int numpages, pgprot_t prot); | 28 | int change_page_attr_addr(unsigned long addr, int numpages, pgprot_t prot); |
29 | 29 | ||
30 | #ifdef CONFIG_DEBUG_RODATA | ||
31 | void mark_rodata_ro(void); | ||
32 | #endif | ||
33 | |||
30 | #endif /* _X8664_CACHEFLUSH_H */ | 34 | #endif /* _X8664_CACHEFLUSH_H */ |
diff --git a/include/asm-x86_64/mman.h b/include/asm-x86_64/mman.h index 78e60a4fd4ee..d0e97b74f735 100644 --- a/include/asm-x86_64/mman.h +++ b/include/asm-x86_64/mman.h | |||
@@ -36,6 +36,7 @@ | |||
36 | #define MADV_SEQUENTIAL 0x2 /* read-ahead aggressively */ | 36 | #define MADV_SEQUENTIAL 0x2 /* read-ahead aggressively */ |
37 | #define MADV_WILLNEED 0x3 /* pre-fault pages */ | 37 | #define MADV_WILLNEED 0x3 /* pre-fault pages */ |
38 | #define MADV_DONTNEED 0x4 /* discard these pages */ | 38 | #define MADV_DONTNEED 0x4 /* discard these pages */ |
39 | #define MADV_REMOVE 0x5 /* remove these pages & resources */ | ||
39 | 40 | ||
40 | /* compatibility flags */ | 41 | /* compatibility flags */ |
41 | #define MAP_ANON MAP_ANONYMOUS | 42 | #define MAP_ANON MAP_ANONYMOUS |
diff --git a/include/asm-x86_64/mpspec.h b/include/asm-x86_64/mpspec.h index 6f8a17d105ab..10248a9a0582 100644 --- a/include/asm-x86_64/mpspec.h +++ b/include/asm-x86_64/mpspec.h | |||
@@ -76,7 +76,7 @@ struct mpc_config_bus | |||
76 | { | 76 | { |
77 | unsigned char mpc_type; | 77 | unsigned char mpc_type; |
78 | unsigned char mpc_busid; | 78 | unsigned char mpc_busid; |
79 | unsigned char mpc_bustype[6] __attribute((packed)); | 79 | unsigned char mpc_bustype[6]; |
80 | }; | 80 | }; |
81 | 81 | ||
82 | /* List of Bus Type string values, Intel MP Spec. */ | 82 | /* List of Bus Type string values, Intel MP Spec. */ |
diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h index ecf58c7c1650..02888d7a496f 100644 --- a/include/asm-x86_64/pgtable.h +++ b/include/asm-x86_64/pgtable.h | |||
@@ -122,6 +122,8 @@ static inline pte_t ptep_get_and_clear_full(struct mm_struct *mm, unsigned long | |||
122 | 122 | ||
123 | #define pte_same(a, b) ((a).pte == (b).pte) | 123 | #define pte_same(a, b) ((a).pte == (b).pte) |
124 | 124 | ||
125 | #define pte_pgprot(a) (__pgprot((a).pte & ~PHYSICAL_PAGE_MASK)) | ||
126 | |||
125 | #define PMD_SIZE (1UL << PMD_SHIFT) | 127 | #define PMD_SIZE (1UL << PMD_SHIFT) |
126 | #define PMD_MASK (~(PMD_SIZE-1)) | 128 | #define PMD_MASK (~(PMD_SIZE-1)) |
127 | #define PUD_SIZE (1UL << PUD_SHIFT) | 129 | #define PUD_SIZE (1UL << PUD_SHIFT) |
diff --git a/include/asm-x86_64/system.h b/include/asm-x86_64/system.h index 85348e02ad2e..b34cc2ee222b 100644 --- a/include/asm-x86_64/system.h +++ b/include/asm-x86_64/system.h | |||
@@ -315,6 +315,8 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, | |||
315 | #define local_irq_enable() __asm__ __volatile__("sti": : :"memory") | 315 | #define local_irq_enable() __asm__ __volatile__("sti": : :"memory") |
316 | /* used in the idle loop; sti takes one instruction cycle to complete */ | 316 | /* used in the idle loop; sti takes one instruction cycle to complete */ |
317 | #define safe_halt() __asm__ __volatile__("sti; hlt": : :"memory") | 317 | #define safe_halt() __asm__ __volatile__("sti; hlt": : :"memory") |
318 | /* used when interrupts are already enabled or to shutdown the processor */ | ||
319 | #define halt() __asm__ __volatile__("hlt": : :"memory") | ||
318 | 320 | ||
319 | #define irqs_disabled() \ | 321 | #define irqs_disabled() \ |
320 | ({ \ | 322 | ({ \ |