Commit 26af245f authored by Anton Blanchard's avatar Anton Blanchard

Merge samba.org:/scratch/anton/linux-2.5_ppc64_Makefilecleanup

into samba.org:/scratch/anton/linux-2.5_ppc64_new
parents 51fc6594 b67c0d12
...@@ -90,7 +90,9 @@ _STATIC(__start) ...@@ -90,7 +90,9 @@ _STATIC(__start)
* between physical addresses and absolute addresses) and * between physical addresses and absolute addresses) and
* to the pidhash table (also used by the debugger) */ * to the pidhash table (also used by the debugger) */
.llong msChunks-KERNELBASE .llong msChunks-KERNELBASE
#ifdef CONFIG_PPC_ISERIES
.llong pidhash-KERNELBASE .llong pidhash-KERNELBASE
#endif
/* Offset 0x38 - Pointer to start of embedded System.map */ /* Offset 0x38 - Pointer to start of embedded System.map */
.globl embedded_sysmap_start .globl embedded_sysmap_start
......
...@@ -213,7 +213,7 @@ asmlinkage long sys32_readv(u32 fd, struct iovec32 *vector, u32 count) ...@@ -213,7 +213,7 @@ asmlinkage long sys32_readv(u32 fd, struct iovec32 *vector, u32 count)
goto bad_file; goto bad_file;
if (file->f_op && (file->f_mode & FMODE_READ) && if (file->f_op && (file->f_mode & FMODE_READ) &&
(file->f_op->readv || file->f_op->read)) (file->f_op->readv || file->f_op->read))
ret = do_readv_writev32(VERIFY_WRITE, file, vector, count); ret = do_readv_writev32(VERIFY_WRITE, file, vector, count);
fput(file); fput(file);
...@@ -238,8 +238,6 @@ asmlinkage long sys32_writev(u32 fd, struct iovec32 *vector, u32 count) ...@@ -238,8 +238,6 @@ asmlinkage long sys32_writev(u32 fd, struct iovec32 *vector, u32 count)
return ret; return ret;
} }
static inline int get_flock(struct flock *kfl, struct flock32 *ufl) static inline int get_flock(struct flock *kfl, struct flock32 *ufl)
{ {
int err; int err;
...@@ -656,8 +654,8 @@ asmlinkage long sys32_select(int n, u32 *inp, u32 *outp, u32 *exp, u32 tvp_x) ...@@ -656,8 +654,8 @@ asmlinkage long sys32_select(int n, u32 *inp, u32 *outp, u32 *exp, u32 tvp_x)
char *bits; char *bits;
unsigned long nn; unsigned long nn;
long timeout; long timeout;
int ret, size; int ret, size, max_fdset;
timeout = MAX_SCHEDULE_TIMEOUT; timeout = MAX_SCHEDULE_TIMEOUT;
if (tvp) { if (tvp) {
time_t sec, usec; time_t sec, usec;
...@@ -679,8 +677,11 @@ asmlinkage long sys32_select(int n, u32 *inp, u32 *outp, u32 *exp, u32 tvp_x) ...@@ -679,8 +677,11 @@ asmlinkage long sys32_select(int n, u32 *inp, u32 *outp, u32 *exp, u32 tvp_x)
ret = -EINVAL; ret = -EINVAL;
if (n < 0) if (n < 0)
goto out_nofds; goto out_nofds;
if (n > current->files->max_fdset)
n = current->files->max_fdset; /* max_fdset can increase, so grab it once to avoid race */
max_fdset = current->files->max_fdset;
if (n > max_fdset)
n = max_fdset;
/* /*
* We need 6 bitmaps (in/out/ex for both incoming and outgoing), * We need 6 bitmaps (in/out/ex for both incoming and outgoing),
......
...@@ -469,11 +469,6 @@ void __init time_init(void) ...@@ -469,11 +469,6 @@ void __init time_init(void)
last_rtc_update = xtime.tv_sec; last_rtc_update = xtime.tv_sec;
write_unlock_irqrestore(&xtime_lock, flags); write_unlock_irqrestore(&xtime_lock, flags);
#ifdef CONFIG_PPC_ISERIES
/* HACK HACK This allows the iSeries profiling to use /proc/profile */
prof_shift = 0;
#endif
/* Not exact, but the timer interrupt takes care of this */ /* Not exact, but the timer interrupt takes care of this */
set_dec(tb_ticks_per_jiffy); set_dec(tb_ticks_per_jiffy);
} }
......
...@@ -99,23 +99,26 @@ mmu_gather_t mmu_gathers[NR_CPUS]; ...@@ -99,23 +99,26 @@ mmu_gather_t mmu_gathers[NR_CPUS];
void show_mem(void) void show_mem(void)
{ {
int pfn, total = 0, reserved = 0; int total = 0, reserved = 0;
int shared = 0, cached = 0; int shared = 0, cached = 0;
struct page *page; struct page *page;
pg_data_t *pgdat;
unsigned long i;
printk("Mem-info:\n"); printk("Mem-info:\n");
show_free_areas(); show_free_areas();
printk("Free swap: %6dkB\n",nr_swap_pages<<(PAGE_SHIFT-10)); printk("Free swap: %6dkB\n",nr_swap_pages<<(PAGE_SHIFT-10));
pfn = max_mapnr; for_each_pgdat(pgdat) {
while (pfn-- > 0) { for (i = 0; i < pgdat->node_size; i++) {
page = pfn_to_page(pfn); page = pgdat->node_mem_map + i;
total++; total++;
if (PageReserved(page)) if (PageReserved(page))
reserved++; reserved++;
else if (PageSwapCache(page)) else if (PageSwapCache(page))
cached++; cached++;
else if (page_count(page)) else if (page_count(page))
shared += page_count(page) - 1; shared += page_count(page) - 1;
}
} }
printk("%d pages of RAM\n",total); printk("%d pages of RAM\n",total);
printk("%d reserved pages\n",reserved); printk("%d reserved pages\n",reserved);
...@@ -498,13 +501,6 @@ void __init paging_init(void) ...@@ -498,13 +501,6 @@ void __init paging_init(void)
} }
#endif #endif
extern unsigned long prof_shift;
extern unsigned long prof_len;
extern unsigned int * prof_buffer;
extern unsigned long dprof_shift;
extern unsigned long dprof_len;
extern unsigned int * dprof_buffer;
void initialize_paca_hardware_interrupt_stack(void); void initialize_paca_hardware_interrupt_stack(void);
void __init mem_init(void) void __init mem_init(void)
...@@ -518,9 +514,8 @@ void __init mem_init(void) ...@@ -518,9 +514,8 @@ void __init mem_init(void)
int datapages = 0; int datapages = 0;
int initpages = 0; int initpages = 0;
max_mapnr = max_low_pfn; num_physpages = max_low_pfn; /* RAM is assumed contiguous */
high_memory = (void *) __va(max_low_pfn * PAGE_SIZE); high_memory = (void *) __va(max_low_pfn * PAGE_SIZE);
num_physpages = max_mapnr; /* RAM is assumed contiguous */
max_pfn = max_low_pfn; max_pfn = max_low_pfn;
#ifdef CONFIG_DISCONTIGMEM #ifdef CONFIG_DISCONTIGMEM
...@@ -542,6 +537,8 @@ void __init mem_init(void) ...@@ -542,6 +537,8 @@ void __init mem_init(void)
PAGE_OFFSET, (unsigned long)__va(lmb_end_of_DRAM())); PAGE_OFFSET, (unsigned long)__va(lmb_end_of_DRAM()));
} }
#else #else
max_mapnr = num_physpages;
totalram_pages += free_all_bootmem(); totalram_pages += free_all_bootmem();
if ( sysmap_size ) if ( sysmap_size )
...@@ -577,10 +574,6 @@ void __init mem_init(void) ...@@ -577,10 +574,6 @@ void __init mem_init(void)
#ifdef CONFIG_PPC_ISERIES #ifdef CONFIG_PPC_ISERIES
create_virtual_bus_tce_table(); create_virtual_bus_tce_table();
/* HACK HACK This allows the iSeries profiling to use /proc/profile */
prof_shift = dprof_shift;
prof_len = dprof_len;
prof_buffer = dprof_buffer;
#endif #endif
} }
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#define _ASM_MMZONE_H_ #define _ASM_MMZONE_H_
#include <linux/config.h> #include <linux/config.h>
#include <asm/smp.h>
#ifdef CONFIG_DISCONTIGMEM #ifdef CONFIG_DISCONTIGMEM
...@@ -21,7 +22,6 @@ extern int numa_node_exists[]; ...@@ -21,7 +22,6 @@ extern int numa_node_exists[];
extern int numa_cpu_lookup_table[]; extern int numa_cpu_lookup_table[];
extern int numa_memory_lookup_table[]; extern int numa_memory_lookup_table[];
#define MAX_NUMNODES 16
#define MAX_MEMORY (1UL << 41) #define MAX_MEMORY (1UL << 41)
/* 256MB regions */ /* 256MB regions */
#define MEMORY_INCREMENT_SHIFT 28 #define MEMORY_INCREMENT_SHIFT 28
...@@ -53,7 +53,6 @@ static inline int pa_to_nid(unsigned long pa) ...@@ -53,7 +53,6 @@ static inline int pa_to_nid(unsigned long pa)
*/ */
#define NODE_DATA(nid) (&node_data[nid]) #define NODE_DATA(nid) (&node_data[nid])
#define node_startnr(nid) (NODE_DATA(nid)->node_start_mapnr)
#define node_size(nid) (NODE_DATA(nid)->node_size) #define node_size(nid) (NODE_DATA(nid)->node_size)
#define node_localnr(pfn, nid) ((pfn) - NODE_DATA(nid)->node_start_pfn) #define node_localnr(pfn, nid) ((pfn) - NODE_DATA(nid)->node_start_pfn)
...@@ -87,6 +86,7 @@ static inline int __cpu_to_node(int cpu) ...@@ -87,6 +86,7 @@ static inline int __cpu_to_node(int cpu)
#define node_mem_map(nid) (NODE_DATA(nid)->node_mem_map) #define node_mem_map(nid) (NODE_DATA(nid)->node_mem_map)
#define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn) #define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn)
#define node_end_pfn(nid) (NODE_DATA(nid)->node_end_pfn)
#define local_mapnr(kvaddr) \ #define local_mapnr(kvaddr) \
( (__pa(kvaddr) >> PAGE_SHIFT) - node_start_pfn(kvaddr_to_nid(kvaddr)) ( (__pa(kvaddr) >> PAGE_SHIFT) - node_start_pfn(kvaddr_to_nid(kvaddr))
...@@ -112,5 +112,8 @@ static inline int __cpu_to_node(int cpu) ...@@ -112,5 +112,8 @@ static inline int __cpu_to_node(int cpu)
page_zone(__tmp)->zone_start_pfn); \ page_zone(__tmp)->zone_start_pfn); \
}) })
/* XXX fix for discontiguous physical memory */
#define discontigmem_pfn_valid(pfn) ((pfn) < num_physpages)
#endif /* CONFIG_DISCONTIGMEM */ #endif /* CONFIG_DISCONTIGMEM */
#endif /* _ASM_MMZONE_H_ */ #endif /* _ASM_MMZONE_H_ */
#ifndef _ASM_MAX_NUMNODES_H
#define _ASM_MAX_NUMNODES_H
#define MAX_NUMNODES 16
#endif /* _ASM_MAX_NUMNODES_H */
...@@ -207,13 +207,15 @@ static inline int get_order(unsigned long size) ...@@ -207,13 +207,15 @@ static inline int get_order(unsigned long size)
#ifdef CONFIG_DISCONTIGMEM #ifdef CONFIG_DISCONTIGMEM
#define page_to_pfn(page) discontigmem_page_to_pfn(page) #define page_to_pfn(page) discontigmem_page_to_pfn(page)
#define pfn_to_page(pfn) discontigmem_pfn_to_page(pfn) #define pfn_to_page(pfn) discontigmem_pfn_to_page(pfn)
#define pfn_valid(pfn) discontigmem_pfn_valid(pfn)
#else #else
#define pfn_to_page(pfn) (mem_map + (pfn)) #define pfn_to_page(pfn) (mem_map + (pfn))
#define page_to_pfn(page) ((unsigned long)((page) - mem_map)) #define page_to_pfn(page) ((unsigned long)((page) - mem_map))
#define pfn_valid(pfn) ((pfn) < max_mapnr)
#endif #endif
#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
#define pfn_valid(pfn) ((pfn) < max_mapnr)
#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
......
...@@ -35,12 +35,7 @@ ...@@ -35,12 +35,7 @@
#define PTRS_PER_PMD (1 << PMD_INDEX_SIZE) #define PTRS_PER_PMD (1 << PMD_INDEX_SIZE)
#define PTRS_PER_PGD (1 << PGD_INDEX_SIZE) #define PTRS_PER_PGD (1 << PGD_INDEX_SIZE)
#if 0 #define USER_PTRS_PER_PGD (TASK_SIZE_USER64 / PGDIR_SIZE)
/* DRENG / PPPBBB This is a compiler bug!!! */
#define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE)
#else
#define USER_PTRS_PER_PGD (1024)
#endif
#define FIRST_USER_PGD_NR 0 #define FIRST_USER_PGD_NR 0
#define EADDR_SIZE (PTE_INDEX_SIZE + PMD_INDEX_SIZE + \ #define EADDR_SIZE (PTE_INDEX_SIZE + PMD_INDEX_SIZE + \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment