From: James S. <jsi...@us...> - 2002-03-22 20:14:07
|
Update of /cvsroot/linuxconsole/ruby/linux/arch/ia64/kernel In directory usw-pr-cvs1:/tmp/cvs-serv1749/linux/arch/ia64/kernel Modified Files: setup.c traps.c Log Message: Synced to 2.5.7 Index: setup.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/ia64/kernel/setup.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- setup.c 26 Dec 2001 17:28:11 -0000 1.3 +++ setup.c 22 Mar 2002 20:13:57 -0000 1.4 @@ -3,7 +3,7 @@ * * Copyright (C) 1998-2001 Hewlett-Packard Co * David Mosberger-Tang <da...@hp...> - * Copyright (C) 1998, 1999, 2001 Stephane Eranian <er...@hp...> + * Stephane Eranian <er...@hp...> * Copyright (C) 2000, Rohit Seth <roh...@in...> * Copyright (C) 1999 VA Linux Systems * Copyright (C) 1999 Walt Drummond <dru...@va...> @@ -27,6 +27,7 @@ #include <linux/seq_file.h> #include <linux/string.h> #include <linux/threads.h> +#include <linux/tty.h> #include <asm/acpi-ext.h> #include <asm/ia32.h> @@ -52,12 +53,10 @@ extern char _end; -#ifdef CONFIG_NUMA - struct cpuinfo_ia64 *boot_cpu_data; -#else - struct cpuinfo_ia64 _cpu_data[NR_CPUS] __attribute__ ((section ("__special_page_section"))); -#endif +unsigned long __per_cpu_offset[NR_CPUS]; +struct cpuinfo_ia64 cpu_info __per_cpu_data; +unsigned long ia64_phys_stacked_size_p8; unsigned long ia64_cycles_per_usec; struct ia64_boot_param *ia64_boot_param; struct screen_info screen_info; @@ -146,6 +145,10 @@ } +/* + * Find a place to put the bootmap and return its starting address in bootmap_start. + * This address must be page-aligned. + */ static int find_bootmap_location (unsigned long start, unsigned long end, void *arg) { @@ -164,7 +167,7 @@ for (i = 0; i < num_rsvd_regions; i++) { range_start = MAX(start, free_start); - range_end = MIN(end, rsvd_region[i].start); + range_end = MIN(end, rsvd_region[i].start & PAGE_MASK); if (range_end <= range_start) continue; /* skip over empty range */ @@ -176,7 +179,7 @@ /* nothing more available in this segment */ if (range_end == end) return 0; - free_start = rsvd_region[i].end; + free_start = PAGE_ALIGN(rsvd_region[i].end); } return 0; } @@ -305,6 +308,10 @@ /* process SAL system table: */ ia64_sal_init(efi.sal_systab); +#ifdef CONFIG_IA64_GENERIC + machvec_init(acpi_get_sysname()); +#endif + /* * Set `iobase' to the appropriate address in region 6 * (uncached access range) @@ -331,10 +338,6 @@ cpu_init(); /* initialize the bootstrap CPU */ -#ifdef CONFIG_IA64_GENERIC - machvec_init(acpi_get_sysname()); -#endif - if (efi.acpi20) { /* Parse the ACPI 2.0 tables */ acpi20_parse(efi.acpi20); @@ -362,17 +365,14 @@ { #ifdef CONFIG_SMP # define lpj c->loops_per_jiffy +# define cpunum c->cpu #else # define lpj loops_per_jiffy +# define cpunum 0 #endif char family[32], features[128], *cp; struct cpuinfo_ia64 *c = v; - unsigned long mask, cpu = c - cpu_data(0); - -#ifdef CONFIG_SMP - if (!(cpu_online_map & (1 << cpu))) - return 0; -#endif + unsigned long mask; mask = c->features; @@ -394,7 +394,7 @@ sprintf(cp, " 0x%lx", mask); seq_printf(m, - "processor : %lu\n" + "processor : %d\n" "vendor : %s\n" "arch : IA-64\n" "family : %s\n" @@ -407,7 +407,7 @@ "cpu MHz : %lu.%06lu\n" "itc MHz : %lu.%06lu\n" "BogoMIPS : %lu.%02lu\n\n", - cpu, c->vendor, family, c->model, c->revision, c->archrev, + cpunum, c->vendor, family, c->model, c->revision, c->archrev, features, c->ppn, c->number, c->proc_freq / 1000000, c->proc_freq % 1000000, c->itc_freq / 1000000, c->itc_freq % 1000000, @@ -418,6 +418,10 @@ static void * c_start (struct seq_file *m, loff_t *pos) { +#ifdef CONFIG_SMP + while (*pos < NR_CPUS && !(cpu_online_map & (1 << *pos))) + ++*pos; +#endif return *pos < NR_CPUS ? cpu_data(*pos) : NULL; } @@ -474,6 +478,9 @@ cpuid.bits[i] = ia64_get_cpuid(i); memcpy(c->vendor, cpuid.field.vendor, 16); +#ifdef CONFIG_SMP + c->cpu = smp_processor_id(); +#endif c->ppn = cpuid.field.ppn; c->number = cpuid.field.number; c->revision = cpuid.field.revision; @@ -493,6 +500,12 @@ c->unimpl_pa_mask = ~((1L<<63) | ((1L << phys_addr_size) - 1)); } +void +setup_per_cpu_areas (void) +{ + /* start_kernel() requires this... */ +} + /* * cpu_init() initializes state that is per-CPU. This function acts * as a 'CPU state barrier', nothing should get across. @@ -500,46 +513,21 @@ void cpu_init (void) { + extern char __per_cpu_start[], __phys_per_cpu_start[], __per_cpu_end[]; extern void __init ia64_mmu_init (void *); unsigned long num_phys_stacked; pal_vm_info_2_u_t vmi; unsigned int max_ctx; - struct cpuinfo_ia64 *my_cpu_data; -#ifdef CONFIG_NUMA - int cpu, order; + struct cpuinfo_ia64 *my_cpu_info; + void *my_cpu_data; + int cpu = smp_processor_id(); - /* - * If NUMA is configured, the cpu_data array is not preallocated. The boot cpu - * allocates entries for every possible cpu. As the remaining cpus come online, - * they reallocate a new cpu_data structure on their local node. This extra work - * is required because some boot code references all cpu_data structures - * before the cpus are actually started. - */ - if (!boot_cpu_data) { - my_cpu_data = alloc_bootmem_pages_node(NODE_DATA(numa_node_id()), - sizeof(struct cpuinfo_ia64)); - boot_cpu_data = my_cpu_data; - my_cpu_data->cpu_data[0] = my_cpu_data; - for (cpu = 1; cpu < NR_CPUS; ++cpu) - my_cpu_data->cpu_data[cpu] - = alloc_bootmem_pages_node(NODE_DATA(numa_node_id()), - sizeof(struct cpuinfo_ia64)); - for (cpu = 1; cpu < NR_CPUS; ++cpu) - memcpy(my_cpu_data->cpu_data[cpu]->cpu_data_ptrs, - my_cpu_data->cpu_data, sizeof(my_cpu_data->cpu_data)); - } else { - order = get_order(sizeof(struct cpuinfo_ia64)); - my_cpu_data = page_address(alloc_pages_node(numa_node_id(), GFP_KERNEL, order)); - memcpy(my_cpu_data, boot_cpu_data->cpu_data[smp_processor_id()], - sizeof(struct cpuinfo_ia64)); - __free_pages(virt_to_page(boot_cpu_data->cpu_data[smp_processor_id()]), - order); - for (cpu = 0; cpu < NR_CPUS; ++cpu) - boot_cpu_data->cpu_data[cpu]->cpu_data[smp_processor_id()] = my_cpu_data; - } -#else - my_cpu_data = cpu_data(smp_processor_id()); -#endif + my_cpu_data = alloc_bootmem_pages(__per_cpu_end - __per_cpu_start); + memcpy(my_cpu_data, __phys_per_cpu_start, __per_cpu_end - __per_cpu_start); + + __per_cpu_offset[cpu] = (char *) my_cpu_data - __per_cpu_start; + + my_cpu_info = my_cpu_data + ((char *) &cpu_info - __per_cpu_start); /* * We can't pass "local_cpu_data" to identify_cpu() because we haven't called @@ -547,7 +535,7 @@ * depends on the data returned by identify_cpu(). We break the dependency by * accessing cpu_data() the old way, through identity mapped space. */ - identify_cpu(my_cpu_data); + identify_cpu(my_cpu_info); /* Clear the stack memory reserved for pt_regs: */ memset(ia64_task_regs(current), 0, sizeof(struct pt_regs)); @@ -568,6 +556,8 @@ atomic_inc(&init_mm.mm_count); current->active_mm = &init_mm; + if (current->mm) + BUG(); ia64_mmu_init(my_cpu_data); @@ -606,5 +596,7 @@ printk ("cpu_init: PAL RSE info failed, assuming 96 physical stacked regs\n"); num_phys_stacked = 96; } - local_cpu_data->phys_stacked_size_p8 = num_phys_stacked*8 + 8; + /* size of physical stacked register partition plus 8 bytes: */ + ia64_phys_stacked_size_p8 = num_phys_stacked*8 + 8; + platform_cpu_init(); } Index: traps.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/ia64/kernel/traps.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- traps.c 15 Mar 2002 18:28:11 -0000 1.1 +++ traps.c 22 Mar 2002 20:13:57 -0000 1.2 @@ -1,7 +1,7 @@ /* * Architecture-specific trap handling. * - * Copyright (C) 1998-2001 Hewlett-Packard Co + * Copyright (C) 1998-2002 Hewlett-Packard Co * David Mosberger-Tang <da...@hp...> * * 05/12/00 grao <gou...@in...> : added isr in siginfo for SIGFPE @@ -32,6 +32,7 @@ #include <linux/kernel.h> #include <linux/init.h> #include <linux/sched.h> +#include <linux/tty.h> #include <asm/hardirq.h> #include <asm/ia32.h> @@ -68,6 +69,7 @@ #endif } else { int loglevel_save = console_loglevel; + oops_in_progress = 0; /* * OK, the message is on the console. Now we call printk() without @@ -129,6 +131,8 @@ /* SIGILL, SIGFPE, SIGSEGV, and SIGBUS want these field initialized: */ siginfo.si_addr = (void *) (regs->cr_iip + ia64_psr(regs)->ri); siginfo.si_imm = break_num; + siginfo.si_flags = 0; /* clear __ISR_VALID */ + siginfo.si_isr = 0; switch (break_num) { case 0: /* unknown error */ @@ -348,6 +352,8 @@ siginfo.si_code = FPE_FLTDIV; } siginfo.si_isr = isr; + siginfo.si_flags = __ISR_VALID; + siginfo.si_imm = 0; force_sig_info(SIGFPE, &siginfo, current); } } else { @@ -368,6 +374,8 @@ siginfo.si_code = FPE_FLTRES; } siginfo.si_isr = isr; + siginfo.si_flags = __ISR_VALID; + siginfo.si_imm = 0; force_sig_info(SIGFPE, &siginfo, current); } } @@ -486,6 +494,8 @@ siginfo.si_errno = 0; siginfo.si_addr = (void *) (regs->cr_iip + ia64_psr(regs)->ri); siginfo.si_imm = vector; + siginfo.si_flags = __ISR_VALID; + siginfo.si_isr = isr; force_sig_info(SIGILL, &siginfo, current); return; } @@ -513,6 +523,10 @@ } siginfo.si_signo = SIGTRAP; siginfo.si_errno = 0; + siginfo.si_flags = 0; + siginfo.si_isr = 0; + siginfo.si_addr = 0; + siginfo.si_imm = 0; force_sig_info(SIGTRAP, &siginfo, current); return; @@ -524,6 +538,9 @@ siginfo.si_errno = 0; siginfo.si_code = FPE_FLTINV; siginfo.si_addr = (void *) (regs->cr_iip + ia64_psr(regs)->ri); + siginfo.si_flags = __ISR_VALID; + siginfo.si_isr = isr; + siginfo.si_imm = 0; force_sig_info(SIGFPE, &siginfo, current); } return; @@ -533,6 +550,9 @@ siginfo.si_signo = SIGILL; siginfo.si_code = ILL_BADIADDR; siginfo.si_errno = 0; + siginfo.si_flags = 0; + siginfo.si_isr = 0; + siginfo.si_imm = 0; siginfo.si_addr = (void *) (regs->cr_iip + ia64_psr(regs)->ri); force_sig_info(SIGILL, &siginfo, current); return; |