diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1999-07-05 23:09:37 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1999-07-05 23:09:37 +0000 |
commit | aba344fdfed81b2c03d6114c54cfd73a486aa10b (patch) | |
tree | d032d8430bf1234c3ecc6f6330d6de6e887e5963 /arch/ppc/kernel | |
parent | 40c138bfc6d37dbff5339f84575db1e3cec6e34e (diff) |
Merge with Linux 2.3.9.
Diffstat (limited to 'arch/ppc/kernel')
-rw-r--r-- | arch/ppc/kernel/Makefile | 6 | ||||
-rw-r--r-- | arch/ppc/kernel/chrp_pci.c | 3 | ||||
-rw-r--r-- | arch/ppc/kernel/chrp_setup.c | 37 | ||||
-rw-r--r-- | arch/ppc/kernel/idle.c | 2 | ||||
-rw-r--r-- | arch/ppc/kernel/irq.c | 6 | ||||
-rw-r--r-- | arch/ppc/kernel/mbx_setup.c | 6 | ||||
-rw-r--r-- | arch/ppc/kernel/misc.S | 12 | ||||
-rw-r--r-- | arch/ppc/kernel/mk_defs.c | 1 | ||||
-rw-r--r-- | arch/ppc/kernel/pmac_setup.c | 44 | ||||
-rw-r--r-- | arch/ppc/kernel/ppc_htab.c | 7 | ||||
-rw-r--r-- | arch/ppc/kernel/ppc_ksyms.c | 26 | ||||
-rw-r--r-- | arch/ppc/kernel/prep_setup.c | 11 | ||||
-rw-r--r-- | arch/ppc/kernel/process.c | 1 | ||||
-rw-r--r-- | arch/ppc/kernel/prom.c | 8 | ||||
-rw-r--r-- | arch/ppc/kernel/setup.c | 13 | ||||
-rw-r--r-- | arch/ppc/kernel/signal.c | 1 | ||||
-rw-r--r-- | arch/ppc/kernel/smp.c | 35 | ||||
-rw-r--r-- | arch/ppc/kernel/syscalls.c | 7 | ||||
-rw-r--r-- | arch/ppc/kernel/time.c | 14 |
19 files changed, 140 insertions, 100 deletions
diff --git a/arch/ppc/kernel/Makefile b/arch/ppc/kernel/Makefile index 1be8c322a..635dd91b5 100644 --- a/arch/ppc/kernel/Makefile +++ b/arch/ppc/kernel/Makefile @@ -56,16 +56,16 @@ ppc_defs.h: mk_defs.c ppc_defs.head \ $(TOPDIR)/include/asm/processor.h \ $(TOPDIR)/include/asm/pgtable.h \ $(TOPDIR)/include/asm/ptrace.h - $(CC) ${CFLAGS} -S mk_defs.c + $(CC) $(CFLAGS) -S mk_defs.c cp ppc_defs.head ppc_defs.h grep '^#define' mk_defs.s >>ppc_defs.h rm mk_defs.s find_name : find_name.c - $(HOSTCC) -o find_name find_name.c + $(HOSTCC) $(HOSTCFLAGS) -o find_name find_name.c checks: checks.c - $(HOSTCC) ${CFLAGS} -D__KERNEL__ -o checks checks.c + $(HOSTCC) $(HOSTCFLAGS) -D__KERNEL__ -o checks checks.c ./checks include $(TOPDIR)/Rules.make diff --git a/arch/ppc/kernel/chrp_pci.c b/arch/ppc/kernel/chrp_pci.c index 575b65918..c82671947 100644 --- a/arch/ppc/kernel/chrp_pci.c +++ b/arch/ppc/kernel/chrp_pci.c @@ -354,7 +354,8 @@ chrp_setup_pci_ptrs(void) } else { - if ( !strncmp("IBM,7043-150", get_property(find_path_device("/"), "name", NULL),12) ) + if ( !strncmp("IBM,7043-150", get_property(find_path_device("/"), "name", NULL),12) || + !strncmp("IBM,7046-155", get_property(find_path_device("/"), "name", NULL),12) ) { pci_dram_offset = 0; isa_mem_base = 0x80000000; diff --git a/arch/ppc/kernel/chrp_setup.c b/arch/ppc/kernel/chrp_setup.c index 25c262d0e..1653ef0d7 100644 --- a/arch/ppc/kernel/chrp_setup.c +++ b/arch/ppc/kernel/chrp_setup.c @@ -48,6 +48,7 @@ #include <asm/irq.h> #include <asm/adb.h> #include <asm/hydra.h> +#include <asm/keyboard.h> #include "time.h" #include "local_irq.h" @@ -66,7 +67,6 @@ extern volatile unsigned char *chrp_int_ack_special; unsigned long chrp_get_rtc_time(void); int chrp_set_rtc_time(unsigned long nowtime); -unsigned long rtas_event_scan_rate = 0, rtas_event_scan_ct = 0; void chrp_calibrate_decr(void); void chrp_time_init(void); @@ -281,7 +281,7 @@ __initfunc(void /* * Fix the Super I/O configuration */ - /*sio_init();*/ + sio_init(); #ifdef CONFIG_DUMMY_CONSOLE conswitchp = &dummy_con; #endif @@ -295,15 +295,16 @@ __initfunc(void struct property *p; device = find_devices("rtas"); for ( p = device->properties; - strncmp(p->name, "rtas-event-scan-rate", 20) && p ; + p && strncmp(p->name, "rtas-event-scan-rate", 20); p = p->next ) /* nothing */ ; if ( p && *(unsigned long *)p->value ) { - rtas_event_scan_rate = (HZ/(*(unsigned long *)p->value)*30)-1; - rtas_event_scan_ct = 1; + ppc_md.heartbeat = chrp_event_scan; + ppc_md.heartbeat_reset = (HZ/(*(unsigned long *)p->value)*30)-1; + ppc_md.heartbeat_count = 1; printk("RTAS Event Scan Rate: %lu (%lu jiffies)\n", - *(unsigned long *)p->value, rtas_event_scan_rate ); + *(unsigned long *)p->value, ppc_md.heartbeat_reset ); } } } @@ -312,11 +313,8 @@ void chrp_event_scan(void) { unsigned char log[1024]; - if ( rtas_event_scan_rate && (rtas_event_scan_ct-- <= 0) ) - { - call_rtas( "event-scan", 4, 1, NULL, 0x0, 1, __pa(log), 1024 ); - rtas_event_scan_ct = rtas_event_scan_rate; - } + call_rtas( "event-scan", 4, 1, NULL, 0x0, 1, __pa(log), 1024 ); + ppc_md.heartbeat_count = ppc_md.heartbeat_reset; } void @@ -331,7 +329,7 @@ void chrp_power_off(void) { /* allow power on only with power button press */ -#define PWR_FIELD(x) (0x8000000000000000 >> ((x)-96)) +#define PWR_FIELD(x) (0x8000000000000000ULL >> ((x)-96)) printk("RTAS power-off returned %d\n", call_rtas("power-off", 2, 1, NULL, ((PWR_FIELD(96)|PWR_FIELD(97))>>32)&0xffffffff, @@ -632,7 +630,8 @@ __initfunc(void ppc_md.kbd_leds = pckbd_leds; ppc_md.kbd_init_hw = pckbd_init_hw; #ifdef CONFIG_MAGIC_SYSRQ - ppc_md.kbd_sysrq_xlate = pckbd_sysrq_xlate; + ppc_md.ppc_kbd_sysrq_xlate = pckbd_sysrq_xlate; + SYSRQ_KEY = 0x54; #endif } else @@ -644,7 +643,8 @@ __initfunc(void ppc_md.kbd_leds = mackbd_leds; ppc_md.kbd_init_hw = mackbd_init_hw; #ifdef CONFIG_MAGIC_SYSRQ - ppc_md.kbd_sysrq_xlate = mackbd_sysrq_xlate; + ppc_md.ppc_kbd_sysrq_xlate = mackbd_sysrq_xlate; + SYSRQ_KEY = 0x69; #endif } #else @@ -655,7 +655,8 @@ __initfunc(void ppc_md.kbd_leds = pckbd_leds; ppc_md.kbd_init_hw = pckbd_init_hw; #ifdef CONFIG_MAGIC_SYSRQ - ppc_md.kbd_sysrq_xlate = pckbd_sysrq_xlate; + ppc_md.ppc_kbd_sysrq_xlate = pckbd_sysrq_xlate; + SYSRQ_KEY = 0x54; #endif #endif #endif @@ -665,9 +666,9 @@ __initfunc(void ppc_ide_md.outsw = chrp_ide_outsw; ppc_ide_md.default_irq = chrp_ide_default_irq; ppc_ide_md.default_io_base = chrp_ide_default_io_base; - ppc_ide_md.check_region = chrp_ide_check_region; - ppc_ide_md.request_region = chrp_ide_request_region; - ppc_ide_md.release_region = chrp_ide_release_region; + ppc_ide_md.ide_check_region = chrp_ide_check_region; + ppc_ide_md.ide_request_region = chrp_ide_request_region; + ppc_ide_md.ide_release_region = chrp_ide_release_region; ppc_ide_md.fix_driveid = chrp_ide_fix_driveid; ppc_ide_md.ide_init_hwif = chrp_ide_init_hwif_ports; diff --git a/arch/ppc/kernel/idle.c b/arch/ppc/kernel/idle.c index 38ac7d108..9d8d94e51 100644 --- a/arch/ppc/kernel/idle.c +++ b/arch/ppc/kernel/idle.c @@ -298,7 +298,7 @@ void power_save(void) case 7: /* 603ev */ case 8: /* 750 */ save_flags(msr); - cli(); + __cli(); if (!current->need_resched) { asm("mfspr %0,1008" : "=r" (hid0) :); hid0 &= ~(HID0_NAP | HID0_SLEEP | HID0_DOZE); diff --git a/arch/ppc/kernel/irq.c b/arch/ppc/kernel/irq.c index 732a87f69..b9cdca892 100644 --- a/arch/ppc/kernel/irq.c +++ b/arch/ppc/kernel/irq.c @@ -189,6 +189,12 @@ void free_irq(unsigned int irq, void *dev_id) request_irq(irq, NULL, 0, NULL, dev_id); } +/* XXX should implement irq disable depth like on intel */ +void disable_irq_nosync(unsigned int irq_nr) +{ + mask_irq(irq_nr); +} + void disable_irq(unsigned int irq_nr) { mask_irq(irq_nr); diff --git a/arch/ppc/kernel/mbx_setup.c b/arch/ppc/kernel/mbx_setup.c index 40f016fb5..fdb9c11e0 100644 --- a/arch/ppc/kernel/mbx_setup.c +++ b/arch/ppc/kernel/mbx_setup.c @@ -473,9 +473,9 @@ mbx_init(unsigned long r3, unsigned long r4, unsigned long r5, ppc_ide_md.outsw = mbx_ide_outsw; ppc_ide_md.default_irq = mbx_ide_default_irq; ppc_ide_md.default_io_base = mbx_ide_default_io_base; - ppc_ide_md.check_region = mbx_ide_check_region; - ppc_ide_md.request_region = mbx_ide_request_region; - ppc_ide_md.release_region = mbx_ide_release_region; + ppc_ide_md.ide_check_region = mbx_ide_check_region; + ppc_ide_md.ide_request_region = mbx_ide_request_region; + ppc_ide_md.ide_release_region = mbx_ide_release_region; ppc_ide_md.fix_driveid = mbx_ide_fix_driveid; ppc_ide_md.ide_init_hwif = mbx_ide_init_hwif_ports; diff --git a/arch/ppc/kernel/misc.S b/arch/ppc/kernel/misc.S index 7e2db0843..0caf06a3b 100644 --- a/arch/ppc/kernel/misc.S +++ b/arch/ppc/kernel/misc.S @@ -650,17 +650,19 @@ __clear_msr_me: /* * Create a kernel thread - * __kernel_thread(flags, fn, arg) + * kernel_thread(fn, arg, flags) */ -_GLOBAL(__kernel_thread) +_GLOBAL(kernel_thread) + mr r6,r3 /* function */ + ori r3,r5,CLONE_VM /* flags */ li r0,__NR_clone sc cmpi 0,r3,0 /* parent or child? */ bnelr /* return if parent */ li r0,0 /* clear out p->tss.regs */ stw r0,TSS+PT_REGS(r2) /* since we don't have user ctx */ - mtlr r4 /* fn addr in lr */ - mr r3,r5 /* load arg and call fn */ + mtlr r6 /* fn addr in lr */ + mr r3,r4 /* load arg and call fn */ blrl li r0,__NR_exit /* exit after child exits */ li r3,0 @@ -866,7 +868,7 @@ sys_call_table: .long sys_getresuid /* 165 */ .long sys_query_module .long sys_poll -#ifdef CONFIG_NFS +#ifdef CONFIG_NFSD .long sys_nfsservctl #else .long sys_ni_syscall diff --git a/arch/ppc/kernel/mk_defs.c b/arch/ppc/kernel/mk_defs.c index b66ccffa8..a3977193a 100644 --- a/arch/ppc/kernel/mk_defs.c +++ b/arch/ppc/kernel/mk_defs.c @@ -97,5 +97,6 @@ main(void) DEFINE(ORIG_GPR3, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, orig_gpr3)); DEFINE(RESULT, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, result)); DEFINE(TRAP, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, trap)); + DEFINE(CLONE_VM, CLONE_VM); return 0; } diff --git a/arch/ppc/kernel/pmac_setup.c b/arch/ppc/kernel/pmac_setup.c index afa1227a7..ffdc316ed 100644 --- a/arch/ppc/kernel/pmac_setup.c +++ b/arch/ppc/kernel/pmac_setup.c @@ -42,6 +42,7 @@ #include <linux/vt_kern.h> #include <linux/console.h> #include <linux/ide.h> +#include <linux/pci.h> #include <asm/prom.h> #include <asm/system.h> #include <asm/pgtable.h> @@ -56,6 +57,7 @@ #include <asm/feature.h> #include <asm/ide.h> #include <asm/machdep.h> +#include <asm/keyboard.h> #include "time.h" #include "local_irq.h" @@ -98,6 +100,7 @@ extern char saved_command_line[]; extern void zs_kgdb_hook(int tty_num); static void ohare_init(void); +static void init_p2pbridge(void); __pmac int @@ -255,6 +258,7 @@ pmac_setup_arch(unsigned long *memory_start_p, unsigned long *memory_end_p)) ohare_init(); *memory_start_p = pmac_find_bridges(*memory_start_p, *memory_end_p); + init_p2pbridge(); /* Checks "l2cr-value" property in the registry */ if ( (_get_PVR() >> 16) == 8) { @@ -299,6 +303,31 @@ pmac_setup_arch(unsigned long *memory_start_p, unsigned long *memory_end_p)) ROOT_DEV = to_kdev_t(DEFAULT_ROOT_DEVICE); } +/* + * Tweak the PCI-PCI bridge chip on the blue & white G3s. + */ +__initfunc(static void init_p2pbridge(void)) +{ + struct device_node *p2pbridge; + unsigned char bus, devfn; + unsigned short val; + + /* XXX it would be better here to identify the specific + PCI-PCI bridge chip we have. */ + if ((p2pbridge = find_devices("pci-bridge")) == 0 + || p2pbridge->parent == NULL + || strcmp(p2pbridge->parent->name, "pci") != 0) + return; + + if (pci_device_loc(p2pbridge, &bus, &devfn) < 0) + return; + + pcibios_read_config_word(bus, devfn, PCI_BRIDGE_CONTROL, &val); + val &= ~PCI_BRIDGE_CTL_MASTER_ABORT; + pcibios_write_config_word(bus, devfn, PCI_BRIDGE_CONTROL, val); + pcibios_read_config_word(bus, devfn, PCI_BRIDGE_CONTROL, &val); +} + __initfunc(static void ohare_init(void)) { /* @@ -488,13 +517,13 @@ pmac_halt(void) void pmac_ide_insw(ide_ioreg_t port, void *buf, int ns) { - ide_insw(port, buf, ns); + _insw_ns(port+_IO_BASE, buf, ns); } void pmac_ide_outsw(ide_ioreg_t port, void *buf, int ns) { - ide_outsw(port, buf, ns); + _outsw_ns(port+_IO_BASE, buf, ns); } int @@ -596,7 +625,8 @@ pmac_init(unsigned long r3, unsigned long r4, unsigned long r5, ppc_md.kbd_leds = mackbd_leds; ppc_md.kbd_init_hw = mackbd_init_hw; #ifdef CONFIG_MAGIC_SYSRQ - ppc_md.kbd_sysrq_xlate = mackbd_sysrq_xlate; + ppc_md.ppc_kbd_sysrq_xlate = mackbd_sysrq_xlate; + SYSRQ_KEY = 0x69; #endif #endif @@ -605,13 +635,13 @@ pmac_init(unsigned long r3, unsigned long r4, unsigned long r5, ppc_ide_md.outsw = pmac_ide_outsw; ppc_ide_md.default_irq = pmac_ide_default_irq; ppc_ide_md.default_io_base = pmac_ide_default_io_base; - ppc_ide_md.check_region = pmac_ide_check_region; - ppc_ide_md.request_region = pmac_ide_request_region; - ppc_ide_md.release_region = pmac_ide_release_region; + ppc_ide_md.ide_check_region = pmac_ide_check_region; + ppc_ide_md.ide_request_region = pmac_ide_request_region; + ppc_ide_md.ide_release_region = pmac_ide_release_region; ppc_ide_md.fix_driveid = pmac_ide_fix_driveid; ppc_ide_md.ide_init_hwif = pmac_ide_init_hwif_ports; - ppc_ide_md.io_base = 0; + ppc_ide_md.io_base = _IO_BASE; /* actually too early for this :-( */ #endif } diff --git a/arch/ppc/kernel/ppc_htab.c b/arch/ppc/kernel/ppc_htab.c index 30123c076..a2aab8354 100644 --- a/arch/ppc/kernel/ppc_htab.c +++ b/arch/ppc/kernel/ppc_htab.c @@ -74,11 +74,14 @@ struct inode_operations proc_ppc_htab_inode_operations = { NULL, /* rename */ NULL, /* readlink */ NULL, /* follow_link */ + NULL, /* get_block */ NULL, /* readpage */ NULL, /* writepage */ - NULL, /* bmap */ + NULL, /* flushpage */ NULL, /* truncate */ - NULL /* permission */ + NULL, /* permission */ + NULL, /* smap */ + NULL /* revalidate */ }; /* these will go into processor.h when I'm done debugging -- Cort */ diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c index 36a68ffd6..1d1340331 100644 --- a/arch/ppc/kernel/ppc_ksyms.c +++ b/arch/ppc/kernel/ppc_ksyms.c @@ -31,8 +31,8 @@ #include <asm/dma.h> #include <asm/machdep.h> -#define __KERNEL_SYSCALLS__ -#include <linux/unistd.h> +/* Tell string.h we don't want memcpy etc. as cpp defines */ +#define EXPORT_SYMTAB_STROPS extern void transfer_to_handler(void); extern void int_return(void); @@ -47,7 +47,6 @@ extern atomic_t ppc_n_lost_interrupts; extern void do_lost_interrupts(unsigned long); extern int do_signal(sigset_t *, struct pt_regs *); -asmlinkage long long __ashrdi3(long long, int); asmlinkage int abs(int); EXPORT_SYMBOL(clear_page); @@ -66,6 +65,7 @@ EXPORT_SYMBOL(ppc_n_lost_interrupts); EXPORT_SYMBOL(do_lost_interrupts); EXPORT_SYMBOL(enable_irq); EXPORT_SYMBOL(disable_irq); +EXPORT_SYMBOL(disable_irq_nosync); EXPORT_SYMBOL(ppc_local_irq_count); EXPORT_SYMBOL(ppc_local_bh_count); @@ -112,11 +112,6 @@ EXPORT_SYMBOL(strnlen); EXPORT_SYMBOL(strspn); EXPORT_SYMBOL(strcmp); EXPORT_SYMBOL(strncmp); -EXPORT_SYMBOL(memset); -EXPORT_SYMBOL(memcpy); -EXPORT_SYMBOL(memmove); -EXPORT_SYMBOL(memscan); -EXPORT_SYMBOL(memcmp); /* EXPORT_SYMBOL(csum_partial); already in net/netsyms.c */ EXPORT_SYMBOL(csum_partial_copy_generic); @@ -153,9 +148,10 @@ EXPORT_SYMBOL(iounmap); EXPORT_SYMBOL(ide_insw); EXPORT_SYMBOL(ide_outsw); +EXPORT_SYMBOL(ppc_ide_md); EXPORT_SYMBOL(start_thread); -EXPORT_SYMBOL(__kernel_thread); +EXPORT_SYMBOL(kernel_thread); EXPORT_SYMBOL(__cli); EXPORT_SYMBOL(__sti); @@ -215,11 +211,11 @@ EXPORT_SYMBOL(nvram_read_byte); EXPORT_SYMBOL(nvram_write_byte); #endif /* CONFIG_PMAC */ +EXPORT_SYMBOL_NOVERS(memcpy); +EXPORT_SYMBOL_NOVERS(memset); +EXPORT_SYMBOL_NOVERS(memmove); +EXPORT_SYMBOL_NOVERS(memscan); +EXPORT_SYMBOL_NOVERS(memcmp); + EXPORT_SYMBOL(abs); EXPORT_SYMBOL(device_is_compatible); - -/* The following are special because they're not called - explicitly (the C compiler generates them). Fortunately, - their interface isn't gonna change any time soon now, so - it's OK to leave it out of version control. */ -EXPORT_SYMBOL_NOVERS(__ashrdi3); diff --git a/arch/ppc/kernel/prep_setup.c b/arch/ppc/kernel/prep_setup.c index 45c64837c..05d46a698 100644 --- a/arch/ppc/kernel/prep_setup.c +++ b/arch/ppc/kernel/prep_setup.c @@ -48,7 +48,7 @@ #include <asm/mk48t59.h> #include <asm/prep_nvram.h> #include <asm/raven.h> - +#include <asm/keyboard.h> #include "time.h" #include "local_irq.h" @@ -825,9 +825,9 @@ prep_init(unsigned long r3, unsigned long r4, unsigned long r5, ppc_ide_md.outsw = prep_ide_outsw; ppc_ide_md.default_irq = prep_ide_default_irq; ppc_ide_md.default_io_base = prep_ide_default_io_base; - ppc_ide_md.check_region = prep_ide_check_region; - ppc_ide_md.request_region = prep_ide_request_region; - ppc_ide_md.release_region = prep_ide_release_region; + ppc_ide_md.ide_check_region = prep_ide_check_region; + ppc_ide_md.ide_request_region = prep_ide_request_region; + ppc_ide_md.ide_release_region = prep_ide_release_region; ppc_ide_md.fix_driveid = prep_ide_fix_driveid; ppc_ide_md.ide_init_hwif = prep_ide_init_hwif_ports; #endif @@ -841,7 +841,8 @@ prep_init(unsigned long r3, unsigned long r4, unsigned long r5, ppc_md.kbd_leds = pckbd_leds; ppc_md.kbd_init_hw = pckbd_init_hw; #ifdef CONFIG_MAGIC_SYSRQ - ppc_md.kbd_sysrq_xlate = pckbd_sysrq_xlate; + ppc_md.ppc_kbd_sysrq_xlate = pckbd_sysrq_xlate; + SYSRQ_KEY = 0x54; #endif #endif } diff --git a/arch/ppc/kernel/process.c b/arch/ppc/kernel/process.c index 0147d427d..dcf6d9b9d 100644 --- a/arch/ppc/kernel/process.c +++ b/arch/ppc/kernel/process.c @@ -306,6 +306,7 @@ copy_thread(int nr, unsigned long clone_flags, unsigned long usp, p->tss.fpscr = current->tss.fpscr; childregs->msr &= ~MSR_FP; + p->processor = 0; #ifdef __SMP__ p->last_processor = NO_PROC_ID; #endif /* __SMP__ */ diff --git a/arch/ppc/kernel/prom.c b/arch/ppc/kernel/prom.c index 4c275dc9d..9c0efa754 100644 --- a/arch/ppc/kernel/prom.c +++ b/arch/ppc/kernel/prom.c @@ -338,7 +338,9 @@ prom_init(int r3, int r4, prom_entry pp) */ model = (char *) early_get_property (r4 + bi->deviceTreeOffset, 4, RELOC("model")); - if (model && strcmp(model, RELOC("iMac,1")) == 0) { + if (model + && (strcmp(model, RELOC("iMac,1")) == 0 + || strcmp(model, RELOC("PowerMac1,1")) == 0)) { out_le32((unsigned *)0x80880008, 1); /* XXX */ } } @@ -887,11 +889,11 @@ interpret_pci_props(struct device_node *np, unsigned long mem_start) && (imp = (struct pci_intr_map *) get_property(np->parent, "interrupt-map", &ml)) != 0 && (ip = (int *) get_property(np, "interrupts", &l)) != 0) { - unsigned int busdevfn = pci_addrs[0].addr.a_hi & 0xffff00; + unsigned int devfn = pci_addrs[0].addr.a_hi & 0xff00; np->n_intrs = 0; np->intrs = (struct interrupt_info *) mem_start; for (i = 0; (ml -= sizeof(struct pci_intr_map)) >= 0; ++i) { - if (imp[i].addr.a_hi == busdevfn) { + if (imp[i].addr.a_hi == devfn) { np->intrs[np->n_intrs].line = imp[i].intr; np->intrs[np->n_intrs].sense = 0; ++np->n_intrs; diff --git a/arch/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c index 3fdb35718..a0d67c98e 100644 --- a/arch/ppc/kernel/setup.c +++ b/arch/ppc/kernel/setup.c @@ -80,6 +80,9 @@ int _machine = 0; int have_of = 0; int is_prep = 0; int is_chrp = 0; +#ifdef CONFIG_MAGIC_SYSRQ +unsigned long SYSRQ_KEY; +#endif /* CONFIG_MAGIC_SYSRQ */ /* For MTX/MVME boards.. with Raven/Falcon Chipset Real close to CHRP, but boot like PReP (via PPCbug) There's probably a nicer way to do this.. --Troy */ @@ -160,15 +163,6 @@ void machine_halt(void) ppc_md.halt(); } -#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) -void ide_init_hwif_ports (hw_regs_t *hw, ide_ioreg_t data_port, ide_ioreg_t ctrl_port, int *irq) -{ - if (ppc_ide_md.ide_init_hwif != NULL) { - ppc_ide_md.ide_init_hwif(hw, data_port, ctrl_port, irq); - } -} -#endif - unsigned long cpu_temp(void) { unsigned char thres = 0; @@ -376,7 +370,6 @@ identify_machine(unsigned long r3, unsigned long r4, unsigned long r5, else { _machine = _MACH_Pmac; - is_prep = 1; } } diff --git a/arch/ppc/kernel/signal.c b/arch/ppc/kernel/signal.c index 17c0f55d1..67dfa437c 100644 --- a/arch/ppc/kernel/signal.c +++ b/arch/ppc/kernel/signal.c @@ -455,6 +455,7 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs) default: lock_kernel(); sigaddset(¤t->signal, signr); + recalc_sigpending(current); current->flags |= PF_SIGNALED; do_exit(exit_code); /* NOTREACHED */ diff --git a/arch/ppc/kernel/smp.c b/arch/ppc/kernel/smp.c index 91b4ba041..f40d8d7cc 100644 --- a/arch/ppc/kernel/smp.c +++ b/arch/ppc/kernel/smp.c @@ -243,20 +243,21 @@ void __init smp_boot_cpus(void) { extern struct task_struct *current_set[NR_CPUS]; extern void __secondary_start_psurge(void); - int i; + extern void __secondary_start_chrp(void); + int i, cpu_nr; struct task_struct *p; unsigned long a; printk("Entering SMP Mode...\n"); /* let other processors know to not do certain initialization */ first_cpu_booted = 1; + smp_num_cpus = 1; /* * assume for now that the first cpu booted is * cpu 0, the master -- Cort */ cpu_callin_map[0] = 1; - cpu_callin_map[1] = 0; smp_store_cpu_info(0); active_kernel_processor = 0; current->processor = 0; @@ -282,16 +283,12 @@ void __init smp_boot_cpus(void) { case _MACH_Pmac: /* assume powersurge board - 2 processors -- Cort */ - smp_num_cpus = 2; + cpu_nr = 2; break; case _MACH_chrp: - smp_num_cpus = ((openpic_read(&OpenPIC->Global.Feature_Reporting0) + cpu_nr = ((openpic_read(&OpenPIC->Global.Feature_Reporting0) & OPENPIC_FEATURE_LAST_PROCESSOR_MASK) >> OPENPIC_FEATURE_LAST_PROCESSOR_SHIFT)+1; - /* get our processor # - we may not be cpu 0 */ - printk("SMP %d processors, boot CPU is %d (should be 0)\n", - smp_num_cpus, - 10/*openpic_read(&OpenPIC->Processor[0]._Who_Am_I)*/); break; } @@ -299,7 +296,7 @@ void __init smp_boot_cpus(void) * only check for cpus we know exist. We keep the callin map * with cpus at the bottom -- Cort */ - for ( i = 1 ; i < smp_num_cpus; i++ ) + for ( i = 1 ; i < cpu_nr; i++ ) { int c; @@ -332,6 +329,19 @@ void __init smp_boot_cpus(void) case _MACH_chrp: *(unsigned long *)KERNELBASE = i; asm volatile("dcbf 0,%0"::"r"(KERNELBASE):"memory"); +#if 0 + device = find_type_devices("cpu"); + /* assume cpu device list is in order, find the ith cpu */ + for ( a = i; device && a; device = device->next, a-- ) + ; + if ( !device ) + break; + printk( "Starting %s (%lu): ", device->full_name, + *(ulong *)get_property(device, "reg", NULL) ); + call_rtas( "start-cpu", 3, 1, NULL, + *(ulong *)get_property(device, "reg", NULL), + __pa(__secondary_start_chrp), i); +#endif break; } @@ -349,6 +359,7 @@ void __init smp_boot_cpus(void) /* this sync's the decr's -- Cort */ if ( _machine == _MACH_Pmac ) set_dec(decrementer_count); + smp_num_cpus++; } else { printk("Processor %d is stuck.\n", i); } @@ -366,7 +377,6 @@ void __init smp_boot_cpus(void) void __init smp_commence(void) { - printk("SMP %d: smp_commence()\n",current->processor); /* * Lets the callin's below out of their loop. */ @@ -381,16 +391,12 @@ void __init initialize_secondary(void) /* Activate a secondary processor. */ asmlinkage int __init start_secondary(void *unused) { - printk("SMP %d: start_secondary()\n",current->processor); smp_callin(); return cpu_idle(NULL); } void __init smp_callin(void) { - int i; - - printk("SMP %d: smp_callin()\n",current->processor); smp_store_cpu_info(current->processor); set_dec(decrementer_count); @@ -407,7 +413,6 @@ void __init smp_callin(void) void __init smp_setup(char *str, int *ints) { - printk("SMP %d: smp_setup()\n",current->processor); } int __init setup_profiling_timer(unsigned int multiplier) diff --git a/arch/ppc/kernel/syscalls.c b/arch/ppc/kernel/syscalls.c index 3aa0becef..571b36391 100644 --- a/arch/ppc/kernel/syscalls.c +++ b/arch/ppc/kernel/syscalls.c @@ -33,6 +33,7 @@ #include <linux/sys.h> #include <linux/ipc.h> #include <linux/utsname.h> +#include <linux/file.h> #include <asm/uaccess.h> #include <asm/ipc.h> @@ -201,12 +202,16 @@ asmlinkage unsigned long sys_mmap(unsigned long addr, size_t len, lock_kernel(); if (!(flags & MAP_ANONYMOUS)) { - if (fd >= NR_OPEN || !(file = current->files->fd[fd])) + if (!(file = fget(fd))) goto out; } flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE); + down(¤t->mm->mmap_sem); ret = do_mmap(file, addr, len, prot, flags, offset); + up(¤t->mm->mmap_sem); + if (file) + fput(file); out: unlock_kernel(); return ret; diff --git a/arch/ppc/kernel/time.c b/arch/ppc/kernel/time.c index 6be6b90c2..5990dad90 100644 --- a/arch/ppc/kernel/time.c +++ b/arch/ppc/kernel/time.c @@ -126,17 +126,9 @@ void timer_interrupt(struct pt_regs * regs) smp_local_timer_interrupt(regs); #endif -#ifdef CONFIG_APUS - { - extern void apus_heartbeat (void); - apus_heartbeat (); - } -#endif -#if defined(CONFIG_ALL_PPC) || defined(CONFIG_CHRP) - if ( _machine == _MACH_chrp ) - chrp_event_scan(); -#endif - + if ( ppc_md.heartbeat && !ppc_md.heartbeat_count--) + ppc_md.heartbeat(); + hardirq_exit(cpu); } |