Skip to content

Commit

Permalink
powerpc: Move some extern declarations from C code into headers
Browse files Browse the repository at this point in the history
This also make klimit have the same type on 32-bit as on 64-bit,
namely unsigned long, and defines and initializes it in one place.

Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Paul Mackerras committed Nov 10, 2005
1 parent d3d2176 commit 49b0985
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 21 deletions.
4 changes: 0 additions & 4 deletions arch/powerpc/kernel/prom.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@ struct isa_reg_property {
typedef int interpret_func(struct device_node *, unsigned long *,
int, int, int);

extern struct rtas_t rtas;
extern struct lmb lmb;
extern unsigned long klimit;

static int __initdata dt_root_addr_cells;
static int __initdata dt_root_size_cells;

Expand Down
2 changes: 2 additions & 0 deletions arch/powerpc/kernel/setup-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ int _machine = 0;
EXPORT_SYMBOL(_machine);
#endif

unsigned long klimit = (unsigned long) _end;

/*
* This still seems to be needed... -- paulus
*/
Expand Down
3 changes: 1 addition & 2 deletions arch/powerpc/kernel/setup_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ arch_initcall(ppc_init);
/* Warning, IO base is not yet inited */
void __init setup_arch(char **cmdline_p)
{
extern char *klimit;
extern void do_init_bootmem(void);

/* so udelay does something sensible, assume <= 1000 bogomips */
Expand Down Expand Up @@ -338,7 +337,7 @@ void __init setup_arch(char **cmdline_p)
init_mm.start_code = PAGE_OFFSET;
init_mm.end_code = (unsigned long) _etext;
init_mm.end_data = (unsigned long) _edata;
init_mm.brk = (unsigned long) klimit;
init_mm.brk = klimit;

/* Save unparsed command line copy for /proc/cmdline */
strlcpy(saved_command_line, cmd_line, COMMAND_LINE_SIZE);
Expand Down
8 changes: 0 additions & 8 deletions arch/powerpc/kernel/setup_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,6 @@ extern void udbg_init_maple_realmode(void);
do { udbg_putc = call_rtas_display_status_delay; } while(0)
#endif

/* extern void *stab; */
extern unsigned long klimit;

extern void mm_init_ppc64(void);
extern void early_init_devtree(void *flat_dt);
extern void unflatten_device_tree(void);
extern void check_for_initrd(void);

int have_of = 1;
int boot_cpuid = 0;
int boot_cpuid_phys = 0;
Expand Down
3 changes: 0 additions & 3 deletions arch/powerpc/mm/init_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@ void MMU_init(void);
/* XXX should be in current.h -- paulus */
extern struct task_struct *current_set[NR_CPUS];

char *klimit = _end;
struct device_node *memory_node;

extern int init_bootmem_done;

/*
Expand Down
2 changes: 0 additions & 2 deletions arch/powerpc/mm/init_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@
#warning TASK_SIZE is smaller than it needs to be.
#endif

unsigned long klimit = (unsigned long)_end;

/* max amount of RAM to use */
unsigned long __max_memory;

Expand Down
3 changes: 1 addition & 2 deletions arch/powerpc/platforms/iseries/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include <asm/iommu.h>
#include <asm/firmware.h>
#include <asm/systemcfg.h>

#include <asm/system.h>
#include <asm/time.h>
#include <asm/paca.h>
#include <asm/cache.h>
Expand Down Expand Up @@ -85,7 +85,6 @@ static void iSeries_pci_final_fixup(void) { }
int piranha_simulator;

extern int rd_size; /* Defined in drivers/block/rd.c */
extern unsigned long klimit;
extern unsigned long embedded_sysmap_start;
extern unsigned long embedded_sysmap_end;

Expand Down
1 change: 1 addition & 0 deletions include/asm-powerpc/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ extern struct task_struct *_switch(struct thread_struct *prev,
extern unsigned int rtas_data;
extern int mem_init_done; /* set on boot once kmalloc can be called */
extern unsigned long memory_limit;
extern unsigned long klimit;

extern int powersave_nap; /* set if nap mode can be used in idle loop */

Expand Down
1 change: 1 addition & 0 deletions include/asm-ppc64/mmu.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ extern void htab_initialize_secondary(void);
extern void hpte_init_native(void);
extern void hpte_init_lpar(void);
extern void hpte_init_iSeries(void);
extern void mm_init_ppc64(void);

extern long pSeries_lpar_hpte_insert(unsigned long hpte_group,
unsigned long va, unsigned long prpn,
Expand Down

0 comments on commit 49b0985

Please sign in to comment.