mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 19:56:18 +00:00
mm: Get rid of __ZONE_COUNT
It was used to compensate because MAX_NR_ZONES was not available to the #ifdefs. Export MAX_NR_ZONES via the new mechanism and get rid of __ZONE_COUNT. Signed-off-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
ec7cade8c1
commit
97965478a6
2 changed files with 13 additions and 17 deletions
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
#ifdef __KERNEL__
|
#ifdef __KERNEL__
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
|
#ifndef __GENERATING_BOUNDS_H
|
||||||
|
|
||||||
#include <linux/spinlock.h>
|
#include <linux/spinlock.h>
|
||||||
#include <linux/list.h>
|
#include <linux/list.h>
|
||||||
|
@ -15,6 +16,7 @@
|
||||||
#include <linux/seqlock.h>
|
#include <linux/seqlock.h>
|
||||||
#include <linux/nodemask.h>
|
#include <linux/nodemask.h>
|
||||||
#include <linux/pageblock-flags.h>
|
#include <linux/pageblock-flags.h>
|
||||||
|
#include <linux/bounds.h>
|
||||||
#include <asm/atomic.h>
|
#include <asm/atomic.h>
|
||||||
#include <asm/page.h>
|
#include <asm/page.h>
|
||||||
|
|
||||||
|
@ -129,6 +131,8 @@ struct per_cpu_pageset {
|
||||||
#define zone_pcp(__z, __cpu) (&(__z)->pageset[(__cpu)])
|
#define zone_pcp(__z, __cpu) (&(__z)->pageset[(__cpu)])
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif /* !__GENERATING_BOUNDS.H */
|
||||||
|
|
||||||
enum zone_type {
|
enum zone_type {
|
||||||
#ifdef CONFIG_ZONE_DMA
|
#ifdef CONFIG_ZONE_DMA
|
||||||
/*
|
/*
|
||||||
|
@ -177,9 +181,11 @@ enum zone_type {
|
||||||
ZONE_HIGHMEM,
|
ZONE_HIGHMEM,
|
||||||
#endif
|
#endif
|
||||||
ZONE_MOVABLE,
|
ZONE_MOVABLE,
|
||||||
MAX_NR_ZONES
|
__MAX_NR_ZONES
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifndef __GENERATING_BOUNDS_H
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* When a memory allocation must conform to specific limitations (such
|
* When a memory allocation must conform to specific limitations (such
|
||||||
* as being suitable for DMA) the caller will pass in hints to the
|
* as being suitable for DMA) the caller will pass in hints to the
|
||||||
|
@ -188,28 +194,15 @@ enum zone_type {
|
||||||
* match the requested limits. See gfp_zone() in include/linux/gfp.h
|
* match the requested limits. See gfp_zone() in include/linux/gfp.h
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
#if MAX_NR_ZONES < 2
|
||||||
* Count the active zones. Note that the use of defined(X) outside
|
|
||||||
* #if and family is not necessarily defined so ensure we cannot use
|
|
||||||
* it later. Use __ZONE_COUNT to work out how many shift bits we need.
|
|
||||||
*/
|
|
||||||
#define __ZONE_COUNT ( \
|
|
||||||
defined(CONFIG_ZONE_DMA) \
|
|
||||||
+ defined(CONFIG_ZONE_DMA32) \
|
|
||||||
+ 1 \
|
|
||||||
+ defined(CONFIG_HIGHMEM) \
|
|
||||||
+ 1 \
|
|
||||||
)
|
|
||||||
#if __ZONE_COUNT < 2
|
|
||||||
#define ZONES_SHIFT 0
|
#define ZONES_SHIFT 0
|
||||||
#elif __ZONE_COUNT <= 2
|
#elif MAX_NR_ZONES <= 2
|
||||||
#define ZONES_SHIFT 1
|
#define ZONES_SHIFT 1
|
||||||
#elif __ZONE_COUNT <= 4
|
#elif MAX_NR_ZONES <= 4
|
||||||
#define ZONES_SHIFT 2
|
#define ZONES_SHIFT 2
|
||||||
#else
|
#else
|
||||||
#error ZONES_SHIFT -- too many zones configured adjust calculation
|
#error ZONES_SHIFT -- too many zones configured adjust calculation
|
||||||
#endif
|
#endif
|
||||||
#undef __ZONE_COUNT
|
|
||||||
|
|
||||||
struct zone {
|
struct zone {
|
||||||
/* Fields commonly accessed by the page allocator */
|
/* Fields commonly accessed by the page allocator */
|
||||||
|
@ -1008,6 +1001,7 @@ unsigned long __init node_memmap_size_bytes(int, unsigned long, unsigned long);
|
||||||
#define pfn_valid_within(pfn) (1)
|
#define pfn_valid_within(pfn) (1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif /* !__GENERATING_BOUNDS.H */
|
||||||
#endif /* !__ASSEMBLY__ */
|
#endif /* !__ASSEMBLY__ */
|
||||||
#endif /* __KERNEL__ */
|
#endif /* __KERNEL__ */
|
||||||
#endif /* _LINUX_MMZONE_H */
|
#endif /* _LINUX_MMZONE_H */
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#define __GENERATING_BOUNDS_H
|
#define __GENERATING_BOUNDS_H
|
||||||
/* Include headers that define the enum constants of interest */
|
/* Include headers that define the enum constants of interest */
|
||||||
#include <linux/page-flags.h>
|
#include <linux/page-flags.h>
|
||||||
|
#include <linux/mmzone.h>
|
||||||
|
|
||||||
#define DEFINE(sym, val) \
|
#define DEFINE(sym, val) \
|
||||||
asm volatile("\n->" #sym " %0 " #val : : "i" (val))
|
asm volatile("\n->" #sym " %0 " #val : : "i" (val))
|
||||||
|
@ -17,5 +18,6 @@ void foo(void)
|
||||||
{
|
{
|
||||||
/* The enum constants to put into include/linux/bounds.h */
|
/* The enum constants to put into include/linux/bounds.h */
|
||||||
DEFINE(NR_PAGEFLAGS, __NR_PAGEFLAGS);
|
DEFINE(NR_PAGEFLAGS, __NR_PAGEFLAGS);
|
||||||
|
DEFINE(MAX_NR_ZONES, __MAX_NR_ZONES);
|
||||||
/* End of constants */
|
/* End of constants */
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue