From 5232d256b45b3c48dd96d30b5907c0205192197b Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Wed, 20 May 2009 14:23:13 -0700 Subject: SLES10 Fixes (part 6) - Prior to 2.6.17 there were no *_pgdat helper functions in mm/mmzone.c. Instead for_each_zone() operated directly on pgdat_list which may or may not have been exported depending on how your kernel was compiled. Now new configure checks determine if you have the helpers or not, and if the needed symbols are exported. If they are not exported then they are dynamically aquired at runtime by kallsyms_lookup_name(). --- include/sys/vmsystm.h | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/sys/vmsystm.h b/include/sys/vmsystm.h index 71058eef8..75365fde0 100644 --- a/include/sys/vmsystm.h +++ b/include/sys/vmsystm.h @@ -93,26 +93,34 @@ extern get_vmalloc_info_t get_vmalloc_info_fn; #endif /* CONFIG_MMU */ #endif /* HAVE_GET_VMALLOC_INFO */ +#ifdef HAVE_PGDAT_HELPERS /* Source linux/mm/mmzone.c */ -#ifndef HAVE_FIRST_ONLINE_PGDAT +# ifndef HAVE_FIRST_ONLINE_PGDAT typedef struct pglist_data *(*first_online_pgdat_t)(void); extern first_online_pgdat_t first_online_pgdat_fn; -#define first_online_pgdat() first_online_pgdat_fn() -#endif /* HAVE_FIRST_ONLINE_PGDAT */ +# define first_online_pgdat() first_online_pgdat_fn() +# endif /* HAVE_FIRST_ONLINE_PGDAT */ -/* Source linux/mm/mmzone.c */ -#ifndef HAVE_NEXT_ONLINE_PGDAT +# ifndef HAVE_NEXT_ONLINE_PGDAT typedef struct pglist_data *(*next_online_pgdat_t)(struct pglist_data *); extern next_online_pgdat_t next_online_pgdat_fn; -#define next_online_pgdat(pgd) next_online_pgdat_fn(pgd) -#endif /* HAVE_NEXT_ONLINE_PGDAT */ +# define next_online_pgdat(pgd) next_online_pgdat_fn(pgd) +# endif /* HAVE_NEXT_ONLINE_PGDAT */ -/* Source linux/mm/mmzone.c */ -#ifndef HAVE_NEXT_ZONE +# ifndef HAVE_NEXT_ZONE typedef struct zone *(*next_zone_t)(struct zone *); extern next_zone_t next_zone_fn; -#define next_zone(zone) next_zone_fn(zone) -#endif /* HAVE_NEXT_ZONE */ +# define next_zone(zone) next_zone_fn(zone) +# endif /* HAVE_NEXT_ZONE */ + +#else /* HAVE_PGDAT_HELPERS */ + +# ifndef HAVE_PGDAT_LIST +extern struct pglist_data *pgdat_list_addr; +# define pgdat_list pgdat_list_addr +# endif /* HAVE_PGDAT_LIST */ + +#endif /* HAVE_PGDAT_HELPERS */ /* Source linux/mm/vmstat.c */ #ifndef HAVE_ZONE_STAT_ITEM_FIA -- cgit v1.2.3