diff options
Diffstat (limited to 'include/asm-generic')
| -rw-r--r-- | include/asm-generic/bug.h | 20 | ||||
| -rw-r--r-- | include/asm-generic/dma-contiguous.h | 2 | ||||
| -rw-r--r-- | include/asm-generic/pgtable.h | 10 |
3 files changed, 22 insertions, 10 deletions
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h index 2520a6e241dc..7d10f962aa13 100644 --- a/include/asm-generic/bug.h +++ b/include/asm-generic/bug.h | |||
| @@ -3,10 +3,18 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/compiler.h> | 4 | #include <linux/compiler.h> |
| 5 | 5 | ||
| 6 | #ifdef CONFIG_GENERIC_BUG | ||
| 7 | #define BUGFLAG_WARNING (1 << 0) | ||
| 8 | #define BUGFLAG_TAINT(taint) (BUGFLAG_WARNING | ((taint) << 8)) | ||
| 9 | #define BUG_GET_TAINT(bug) ((bug)->flags >> 8) | ||
| 10 | #endif | ||
| 11 | |||
| 12 | #ifndef __ASSEMBLY__ | ||
| 13 | #include <linux/kernel.h> | ||
| 14 | |||
| 6 | #ifdef CONFIG_BUG | 15 | #ifdef CONFIG_BUG |
| 7 | 16 | ||
| 8 | #ifdef CONFIG_GENERIC_BUG | 17 | #ifdef CONFIG_GENERIC_BUG |
| 9 | #ifndef __ASSEMBLY__ | ||
| 10 | struct bug_entry { | 18 | struct bug_entry { |
| 11 | #ifndef CONFIG_GENERIC_BUG_RELATIVE_POINTERS | 19 | #ifndef CONFIG_GENERIC_BUG_RELATIVE_POINTERS |
| 12 | unsigned long bug_addr; | 20 | unsigned long bug_addr; |
| @@ -23,12 +31,6 @@ struct bug_entry { | |||
| 23 | #endif | 31 | #endif |
| 24 | unsigned short flags; | 32 | unsigned short flags; |
| 25 | }; | 33 | }; |
| 26 | #endif /* __ASSEMBLY__ */ | ||
| 27 | |||
| 28 | #define BUGFLAG_WARNING (1 << 0) | ||
| 29 | #define BUGFLAG_TAINT(taint) (BUGFLAG_WARNING | ((taint) << 8)) | ||
| 30 | #define BUG_GET_TAINT(bug) ((bug)->flags >> 8) | ||
| 31 | |||
| 32 | #endif /* CONFIG_GENERIC_BUG */ | 34 | #endif /* CONFIG_GENERIC_BUG */ |
| 33 | 35 | ||
| 34 | /* | 36 | /* |
| @@ -60,7 +62,6 @@ struct bug_entry { | |||
| 60 | * to provide better diagnostics. | 62 | * to provide better diagnostics. |
| 61 | */ | 63 | */ |
| 62 | #ifndef __WARN_TAINT | 64 | #ifndef __WARN_TAINT |
| 63 | #ifndef __ASSEMBLY__ | ||
| 64 | extern __printf(3, 4) | 65 | extern __printf(3, 4) |
| 65 | void warn_slowpath_fmt(const char *file, const int line, | 66 | void warn_slowpath_fmt(const char *file, const int line, |
| 66 | const char *fmt, ...); | 67 | const char *fmt, ...); |
| @@ -69,7 +70,6 @@ void warn_slowpath_fmt_taint(const char *file, const int line, unsigned taint, | |||
| 69 | const char *fmt, ...); | 70 | const char *fmt, ...); |
| 70 | extern void warn_slowpath_null(const char *file, const int line); | 71 | extern void warn_slowpath_null(const char *file, const int line); |
| 71 | #define WANT_WARN_ON_SLOWPATH | 72 | #define WANT_WARN_ON_SLOWPATH |
| 72 | #endif | ||
| 73 | #define __WARN() warn_slowpath_null(__FILE__, __LINE__) | 73 | #define __WARN() warn_slowpath_null(__FILE__, __LINE__) |
| 74 | #define __WARN_printf(arg...) warn_slowpath_fmt(__FILE__, __LINE__, arg) | 74 | #define __WARN_printf(arg...) warn_slowpath_fmt(__FILE__, __LINE__, arg) |
| 75 | #define __WARN_printf_taint(taint, arg...) \ | 75 | #define __WARN_printf_taint(taint, arg...) \ |
| @@ -202,4 +202,6 @@ extern void warn_slowpath_null(const char *file, const int line); | |||
| 202 | # define WARN_ON_SMP(x) ({0;}) | 202 | # define WARN_ON_SMP(x) ({0;}) |
| 203 | #endif | 203 | #endif |
| 204 | 204 | ||
| 205 | #endif /* __ASSEMBLY__ */ | ||
| 206 | |||
| 205 | #endif | 207 | #endif |
diff --git a/include/asm-generic/dma-contiguous.h b/include/asm-generic/dma-contiguous.h index c544356b374b..294b1e755ab2 100644 --- a/include/asm-generic/dma-contiguous.h +++ b/include/asm-generic/dma-contiguous.h | |||
| @@ -18,7 +18,7 @@ static inline void dev_set_cma_area(struct device *dev, struct cma *cma) | |||
| 18 | { | 18 | { |
| 19 | if (dev) | 19 | if (dev) |
| 20 | dev->cma_area = cma; | 20 | dev->cma_area = cma; |
| 21 | if (!dev || !dma_contiguous_default_area) | 21 | if (!dev && !dma_contiguous_default_area) |
| 22 | dma_contiguous_default_area = cma; | 22 | dma_contiguous_default_area = cma; |
| 23 | } | 23 | } |
| 24 | 24 | ||
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index 6f2b45a9b6bc..ff4947b7a976 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h | |||
| @@ -484,6 +484,16 @@ static inline int pmd_none_or_trans_huge_or_clear_bad(pmd_t *pmd) | |||
| 484 | /* | 484 | /* |
| 485 | * The barrier will stabilize the pmdval in a register or on | 485 | * The barrier will stabilize the pmdval in a register or on |
| 486 | * the stack so that it will stop changing under the code. | 486 | * the stack so that it will stop changing under the code. |
| 487 | * | ||
| 488 | * When CONFIG_TRANSPARENT_HUGEPAGE=y on x86 32bit PAE, | ||
| 489 | * pmd_read_atomic is allowed to return a not atomic pmdval | ||
| 490 | * (for example pointing to an hugepage that has never been | ||
| 491 | * mapped in the pmd). The below checks will only care about | ||
| 492 | * the low part of the pmd with 32bit PAE x86 anyway, with the | ||
| 493 | * exception of pmd_none(). So the important thing is that if | ||
| 494 | * the low part of the pmd is found null, the high part will | ||
| 495 | * be also null or the pmd_none() check below would be | ||
| 496 | * confused. | ||
| 487 | */ | 497 | */ |
| 488 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | 498 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE |
| 489 | barrier(); | 499 | barrier(); |
