From: Dave A. <ai...@us...> - 2003-06-10 02:07:50
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/i386/kernel In directory sc8-pr-cvs1:/tmp/cvs-serv23180/arch/i386/kernel Modified Files: apic.c apm.c dmi_scan.c entry.S head.S i386_ksyms.c pci-irq.c pci-pc.c process.c setup.c signal.c time.c vm86.c Log Message: DA: sync to Marcelo 2.4.18 + remove init_mmap (no longer needed) Index: apic.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/i386/kernel/apic.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- apic.c 10 Apr 2002 14:23:20 -0000 1.2 +++ apic.c 10 Jun 2003 01:45:54 -0000 1.3 @@ -56,6 +56,14 @@ maxlvt = get_maxlvt(); /* + * Masking an LVT entry on a P6 can trigger a local APIC error + * if the vector is zero. Mask LVTERR first to prevent this. + */ + if (maxlvt >= 3) { + v = ERROR_APIC_VECTOR; /* any non-zero vector will do */ + apic_write_around(APIC_LVTERR, v | APIC_LVT_MASKED); + } + /* * Careful: we have to set masks only first to deassert * any level-triggered sources. */ @@ -65,10 +73,6 @@ apic_write_around(APIC_LVT0, v | APIC_LVT_MASKED); v = apic_read(APIC_LVT1); apic_write_around(APIC_LVT1, v | APIC_LVT_MASKED); - if (maxlvt >= 3) { - v = apic_read(APIC_LVTERR); - apic_write_around(APIC_LVTERR, v | APIC_LVT_MASKED); - } if (maxlvt >= 4) { v = apic_read(APIC_LVTPC); apic_write_around(APIC_LVTPC, v | APIC_LVT_MASKED); @@ -84,6 +88,12 @@ apic_write_around(APIC_LVTERR, APIC_LVT_MASKED); if (maxlvt >= 4) apic_write_around(APIC_LVTPC, APIC_LVT_MASKED); + v = GET_APIC_VERSION(apic_read(APIC_LVR)); + if (APIC_INTEGRATED(v)) { /* !82489DX */ + if (maxlvt > 3) + apic_write(APIC_ESR, 0); + apic_read(APIC_ESR); + } } void __init connect_bsp_APIC(void) @@ -480,6 +490,7 @@ l &= ~MSR_IA32_APICBASE_BASE; l |= MSR_IA32_APICBASE_ENABLE | APIC_DEFAULT_PHYS_BASE; wrmsr(MSR_IA32_APICBASE, l, h); + apic_write(APIC_LVTERR, ERROR_APIC_VECTOR | APIC_LVT_MASKED); apic_write(APIC_ID, apic_pm_state.apic_id); apic_write(APIC_DFR, apic_pm_state.apic_dfr); apic_write(APIC_LDR, apic_pm_state.apic_ldr); @@ -487,15 +498,15 @@ apic_write(APIC_SPIV, apic_pm_state.apic_spiv); apic_write(APIC_LVT0, apic_pm_state.apic_lvt0); apic_write(APIC_LVT1, apic_pm_state.apic_lvt1); + apic_write(APIC_LVTPC, apic_pm_state.apic_lvtpc); + apic_write(APIC_LVTT, apic_pm_state.apic_lvtt); + apic_write(APIC_TDCR, apic_pm_state.apic_tdcr); + apic_write(APIC_TMICT, apic_pm_state.apic_tmict); apic_write(APIC_ESR, 0); apic_read(APIC_ESR); apic_write(APIC_LVTERR, apic_pm_state.apic_lvterr); apic_write(APIC_ESR, 0); apic_read(APIC_ESR); - apic_write(APIC_LVTPC, apic_pm_state.apic_lvtpc); - apic_write(APIC_LVTT, apic_pm_state.apic_lvtt); - apic_write(APIC_TDCR, apic_pm_state.apic_tdcr); - apic_write(APIC_TMICT, apic_pm_state.apic_tmict); __restore_flags(flags); if (apic_pm_state.perfctr_pmdev) pm_send(apic_pm_state.perfctr_pmdev, PM_RESUME, data); Index: apm.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/i386/kernel/apm.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- apm.c 10 Apr 2002 14:23:20 -0000 1.2 +++ apm.c 10 Jun 2003 01:45:55 -0000 1.3 @@ -39,6 +39,7 @@ * Feb 2000, Version 1.13 * Nov 2000, Version 1.14 * Oct 2001, Version 1.15 + * Jan 2002, Version 1.16 * * History: * 0.6b: first version in official kernel, Linux 1.3.46 @@ -85,7 +86,7 @@ * change APM_NOINTS to CONFIG_APM_ALLOW_INTS * remove dependency on CONFIG_PROC_FS * Stephen Rothwell - * 1.9: Fix small typo. <la...@il...> + * 1.9: Fix small typo. <la...@wo...> * Try to cope with BIOS's that need to have all display * devices blanked and not just the first one. * Ross Paterson <ro...@so...> @@ -164,8 +165,18 @@ * If an APM idle fails log it and idle sensibly * 1.15: Don't queue events to clients who open the device O_WRONLY. * Don't expect replies from clients who open the device O_RDONLY. - * (Idea from Thomas Hood <jdthood at yahoo.co.uk>) - * Minor waitqueue cleanups.(John Fremlin <ch...@ba...>) + * (Idea from Thomas Hood <jd...@ma...>) + * Minor waitqueue cleanups. (John Fremlin <ch...@ba...>) + * 1.16: Fix idle calling. (Andreas Steinmetz <as...@do...> et al.) + * Notify listeners of standby or suspend events before notifying + * drivers. Return EBUSY to ioctl() if suspend is rejected. + * (Russell King <rm...@ar...> and Thomas Hood) + * Ignore first resume after we generate our own resume event + * after a suspend (Thomas Hood <jd...@ma...>) + * Daemonize now gets rid of our controlling terminal (sfr). + * CONFIG_APM_CPU_IDLE now just affects the default value of + * idle_threshold (sfr). + * Change name of kernel apm daemon (as it no longer idles) (sfr). * * APM 1.1 Reference: * @@ -238,6 +249,12 @@ * [no-]power[-_]off power off on shutdown * bounce[-_]interval=<n> number of ticks to ignore suspend * bounces + * idle[-_]threshold=<n> System idle percentage above which to + * make APM BIOS idle calls. Set it to + * 100 to disable. + * idle[-_]period=<n> Period (in 1/100s of a second) over + * which the idle percentage is + * calculated. */ /* KNOWN PROBLEM MACHINES: @@ -341,15 +358,26 @@ #define APM_BIOS_MAGIC 0x4101 /* + * idle percentage above which bios idle calls are done + */ +#ifdef CONFIG_APM_CPU_IDLE +#define DEFAULT_IDLE_THRESHOLD 95 +#else +#define DEFAULT_IDLE_THRESHOLD 100 +#endif +#define DEFAULT_IDLE_PERIOD (100 / 3) + +/* * Local variables */ static struct { unsigned long offset; unsigned short segment; } apm_bios_entry; -#ifdef CONFIG_APM_CPU_IDLE static int clock_slowed; -#endif +static int idle_threshold = DEFAULT_IDLE_THRESHOLD; +static int idle_period = DEFAULT_IDLE_PERIOD; +static int set_pm_idle; static int suspends_pending; static int standbys_pending; static int waiting_for_resume; @@ -388,7 +416,7 @@ static DECLARE_WAIT_QUEUE_HEAD(apm_suspend_waitqueue); static struct apm_user * user_list; -static char driver_version[] = "1.15"; /* no spaces */ +static char driver_version[] = "1.16"; /* no spaces */ /* * APM event names taken from the APM 1.2 specification. These are @@ -684,8 +712,6 @@ return set_power_state(APM_DEVICE_ALL, state); } -#ifdef CONFIG_APM_CPU_IDLE - /** * apm_do_idle - perform power saving * @@ -735,63 +761,89 @@ } } -#if 0 -extern int hlt_counter; - /* - * If no process has been interested in this - * CPU for some time, we want to wake up the - * power management thread - we probably want + * If no process has really been interested in + * the CPU for some time, we want to call BIOS + * power management - we probably want * to conserve power. */ -#define HARD_IDLE_TIMEOUT (HZ/3) +#define IDLE_CALC_LIMIT (HZ * 100) +#define IDLE_LEAKY_MAX 16 -/* This should wake up kapmd and ask it to slow the CPU */ -#define powermanagement_idle() do { } while (0) +static void (*sys_idle)(void); + +extern void default_idle(void); /** * apm_cpu_idle - cpu idling for APM capable Linux * * This is the idling function the kernel executes when APM is available. It - * tries to save processor time directly by using hlt instructions. A - * separate apm thread tries to do the BIOS power management. - * - * N.B. This is curently not used for kernels 2.4.x. + * tries to do BIOS powermanagement based on the average system idle time. + * Furthermore it calls the system default idle routine. */ static void apm_cpu_idle(void) { - unsigned int start_idle; + static int use_apm_idle = 0; + static unsigned int last_jiffies = 0; + static unsigned int last_stime = 0; + + int apm_is_idle = 0; + unsigned int jiffies_since_last_check = jiffies - last_jiffies; + unsigned int t1; + + +recalc: + if (jiffies_since_last_check > IDLE_CALC_LIMIT) { + use_apm_idle = 0; + last_jiffies = jiffies; + last_stime = current->times.tms_stime; + } else if (jiffies_since_last_check > idle_period) { + unsigned int idle_percentage; + + idle_percentage = current->times.tms_stime - last_stime; + idle_percentage *= 100; + idle_percentage /= jiffies_since_last_check; + use_apm_idle = (idle_percentage > idle_threshold); + last_jiffies = jiffies; + last_stime = current->times.tms_stime; + } + + t1 = IDLE_LEAKY_MAX; + + while (!current->need_resched) { + if (use_apm_idle) { + unsigned int t; - start_idle = jiffies; - while (1) { - if (!current->need_resched) { - if (jiffies - start_idle < HARD_IDLE_TIMEOUT) { - if (!current_cpu_data.hlt_works_ok) - continue; - if (hlt_counter) + t = jiffies; + switch (apm_do_idle()) { + case 0: apm_is_idle = 1; + if (t != jiffies) { + if (t1) { + t1 = IDLE_LEAKY_MAX; + continue; + } + } else if (t1) { + t1--; continue; - __cli(); - if (!current->need_resched) - safe_halt(); - else - __sti(); - continue; + } + break; + case 1: apm_is_idle = 1; + break; } - - /* - * Ok, do some power management - we've been idle for too long - */ - powermanagement_idle(); } - - schedule(); - check_pgt_cache(); - start_idle = jiffies; + if (sys_idle) + sys_idle(); + else + default_idle(); + jiffies_since_last_check = jiffies - last_jiffies; + if (jiffies_since_last_check > idle_period) + goto recalc; } + + if (apm_is_idle) + apm_do_busy(); } -#endif -#endif #ifdef CONFIG_SMP static int apm_magic(void * unused) @@ -1133,57 +1185,42 @@ #endif } -static int send_event(apm_event_t event) +static int suspend(int vetoable) { - switch (event) { - case APM_SYS_SUSPEND: - case APM_CRITICAL_SUSPEND: - case APM_USER_SUSPEND: - /* map all suspends to ACPI D3 */ - if (pm_send_all(PM_SUSPEND, (void *)3)) { - if (event == APM_CRITICAL_SUSPEND) { - printk(KERN_CRIT - "apm: Critical suspend was vetoed, " - "expect armageddon\n" ); - return 0; - } + int err; + struct apm_user *as; + + if (pm_send_all(PM_SUSPEND, (void *)3)) { + /* Vetoed */ + if (vetoable) { if (apm_info.connection_version > 0x100) apm_set_power_state(APM_STATE_REJECT); - return 0; + err = -EBUSY; + waiting_for_resume = 0; + printk(KERN_WARNING "apm: suspend was vetoed.\n"); + goto out; } - break; - case APM_NORMAL_RESUME: - case APM_CRITICAL_RESUME: - /* map all resumes to ACPI D0 */ - (void) pm_send_all(PM_RESUME, (void *)0); - break; + printk(KERN_CRIT "apm: suspend was vetoed, but suspending anyway.\n"); } - - return 1; -} - -static int suspend(void) -{ - int err; - struct apm_user *as; - get_time_diff(); cli(); err = apm_set_power_state(APM_STATE_SUSPEND); reinit_timer(); set_time(); + sti(); if (err == APM_NO_ERROR) err = APM_SUCCESS; if (err != APM_SUCCESS) apm_error("suspend", err); - send_event(APM_NORMAL_RESUME); - sti(); + err = (err == APM_SUCCESS) ? 0 : -EIO; + pm_send_all(PM_RESUME, (void *)0); queue_event(APM_NORMAL_RESUME, NULL); + ignore_normal_resume = 1; + out: for (as = user_list; as != NULL; as = as->next) { as->suspend_wait = 0; - as->suspend_result = ((err == APM_SUCCESS) ? 0 : -EIO); + as->suspend_result = err; } - ignore_normal_resume = 1; wake_up_interruptible(&apm_suspend_waitqueue); return err; } @@ -1192,6 +1229,7 @@ { int err; + /* If needed, notify drivers here */ get_time_diff(); err = apm_set_power_state(APM_STATE_STANDBY); if ((err != APM_SUCCESS) && (err != APM_NO_ERROR)) @@ -1235,17 +1273,13 @@ if (ignore_bounce && ((jiffies - last_resume) > bounce_interval)) ignore_bounce = 0; - if (ignore_normal_resume && (event != APM_NORMAL_RESUME)) - ignore_normal_resume = 0; switch (event) { case APM_SYS_STANDBY: case APM_USER_STANDBY: - if (send_event(event)) { - queue_event(event, NULL); - if (standbys_pending <= 0) - standby(); - } + queue_event(event, NULL); + if (standbys_pending <= 0) + standby(); break; case APM_USER_SUSPEND: @@ -1270,12 +1304,10 @@ */ if (waiting_for_resume) return; - if (send_event(event)) { - queue_event(event, NULL); - waiting_for_resume = 1; - if (suspends_pending <= 0) - (void) suspend(); - } + waiting_for_resume = 1; + queue_event(event, NULL); + if (suspends_pending <= 0) + (void) suspend(1); break; case APM_NORMAL_RESUME: @@ -1287,16 +1319,17 @@ if ((event != APM_NORMAL_RESUME) || (ignore_normal_resume == 0)) { set_time(); - send_event(event); + pm_send_all(PM_RESUME, (void *)0); queue_event(event, NULL); } + ignore_normal_resume = 0; break; case APM_CAPABILITY_CHANGE: case APM_LOW_BATTERY: case APM_POWER_STATUS_CHANGE: - send_event(event); queue_event(event, NULL); + /* If needed, notify drivers here */ break; case APM_UPDATE_TIME: @@ -1304,12 +1337,10 @@ break; case APM_CRITICAL_SUSPEND: - send_event(event); /* - * We can only hope it worked - we are not allowed - * to reject a critical suspend. + * We are not allowed to reject a critical suspend. */ - (void) suspend(); + (void) suspend(0); break; } } @@ -1337,63 +1368,24 @@ /* * This is the APM thread main loop. - * - * Check whether we're the only running process to - * decide if we should just power down. - * */ -#define system_idle() (nr_running == 1) static void apm_mainloop(void) { - int timeout = HZ; DECLARE_WAITQUEUE(wait, current); add_wait_queue(&apm_waitqueue, &wait); set_current_state(TASK_INTERRUPTIBLE); for (;;) { - /* Nothing to do, just sleep for the timeout */ - timeout = 2 * timeout; - if (timeout > APM_CHECK_TIMEOUT) - timeout = APM_CHECK_TIMEOUT; - schedule_timeout(timeout); + schedule_timeout(APM_CHECK_TIMEOUT); if (exit_kapmd) break; - /* * Ok, check all events, check for idle (and mark us sleeping * so as not to count towards the load average).. */ set_current_state(TASK_INTERRUPTIBLE); apm_event_handler(); -#ifdef CONFIG_APM_CPU_IDLE - if (!system_idle()) - continue; - - /* - * If we can idle... - */ - if (apm_do_idle() != -1) { - unsigned long start = jiffies; - while ((!exit_kapmd) && system_idle()) { - if (apm_do_idle()) { - set_current_state(TASK_INTERRUPTIBLE); - /* APM needs us to snooze .. either - the BIOS call failed (-1) or it - slowed the clock (1). We sleep - until it talks to us again */ - schedule_timeout(1); - } - if ((jiffies - start) > APM_CHECK_TIMEOUT) { - apm_event_handler(); - start = jiffies; - } - } - apm_do_busy(); - apm_event_handler(); - timeout = 1; - } -#endif } remove_wait_queue(&apm_waitqueue, &wait); } @@ -1479,9 +1471,7 @@ as->standbys_read--; as->standbys_pending--; standbys_pending--; - } else if (!send_event(APM_USER_STANDBY)) - return -EAGAIN; - else + } else queue_event(APM_USER_STANDBY, as); if (standbys_pending <= 0) standby(); @@ -1491,13 +1481,10 @@ as->suspends_read--; as->suspends_pending--; suspends_pending--; - } else if (!send_event(APM_USER_SUSPEND)) - return -EAGAIN; - else + } else queue_event(APM_USER_SUSPEND, as); if (suspends_pending <= 0) { - if (suspend() != APM_SUCCESS) - return -EIO; + return suspend(1); } else { as->suspend_wait = 1; wait_event_interruptible(apm_suspend_waitqueue, @@ -1528,7 +1515,7 @@ if (as->suspends_pending > 0) { suspends_pending -= as->suspends_pending; if (suspends_pending <= 0) - (void) suspend(); + (void) suspend(1); } if (user_list == as) user_list = as->next; @@ -1676,9 +1663,8 @@ daemonize(); - strcpy(current->comm, "kapm-idled"); + strcpy(current->comm, "kapmd"); sigfillset(¤t->blocked); - current->tty = NULL; /* get rid of controlling tty */ if (apm_info.connection_version == 0) { apm_info.connection_version = apm_info.bios.version; @@ -1797,7 +1783,14 @@ if ((strncmp(str, "bounce-interval=", 16) == 0) || (strncmp(str, "bounce_interval=", 16) == 0)) bounce_interval = simple_strtol(str + 16, NULL, 0); - invert = (strncmp(str, "no-", 3) == 0); + if ((strncmp(str, "idle-threshold=", 15) == 0) || + (strncmp(str, "idle_threshold=", 15) == 0)) + idle_threshold = simple_strtol(str + 15, NULL, 0); + if ((strncmp(str, "idle-period=", 12) == 0) || + (strncmp(str, "idle_period=", 12) == 0)) + idle_threshold = simple_strtol(str + 15, NULL, 0); + invert = (strncmp(str, "no-", 3) == 0) || + (strncmp(str, "no_", 3) == 0); if (invert) str += 3; if (strncmp(str, "debug", 5) == 0) @@ -1968,6 +1961,14 @@ misc_register(&apm_device); + if (HZ != 100) + idle_period = (idle_period * HZ) / 100; + if (idle_threshold < 100) { + sys_idle = pm_idle; + pm_idle = apm_cpu_idle; + set_pm_idle = 1; + } + return 0; } @@ -1975,6 +1976,8 @@ { int error; + if (set_pm_idle) + pm_idle = sys_idle; if (((apm_info.bios.flags & APM_BIOS_DISENGAGED) == 0) && (apm_info.connection_version > 0x0100)) { error = apm_engage_power_management(APM_DEVICE_ALL, 0); @@ -2012,5 +2015,11 @@ MODULE_PARM(realmode_power_off, "i"); MODULE_PARM_DESC(realmode_power_off, "Switch to real mode before powering off"); +MODULE_PARM(idle_threshold, "i"); +MODULE_PARM_DESC(idle_threshold, + "System idle percentage above which to make APM BIOS idle calls"); +MODULE_PARM(idle_period, "i"); +MODULE_PARM_DESC(idle_period, + "Period (in sec/100) over which to caculate the idle percentage"); EXPORT_NO_SYMBOLS; Index: dmi_scan.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/i386/kernel/dmi_scan.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- dmi_scan.c 10 Jun 2003 01:13:14 -0000 1.3 +++ dmi_scan.c 10 Jun 2003 01:45:55 -0000 1.4 @@ -467,6 +467,11 @@ MATCH(DMI_PRODUCT_NAME, "PowerEdge 300/"), NO_MATCH, NO_MATCH } }, + { set_bios_reboot, "Dell PowerEdge 2400", { /* Handle problems with rebooting on Dell 300/800's */ + MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"), + MATCH(DMI_PRODUCT_NAME, "PowerEdge 2400"), + NO_MATCH, NO_MATCH + } }, { set_apm_ints, "Dell Inspiron", { /* Allow interrupts during suspend on Dell Inspiron laptops*/ MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"), MATCH(DMI_PRODUCT_NAME, "Inspiron 4000"), Index: entry.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/i386/kernel/entry.S,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- entry.S 10 Apr 2002 14:23:20 -0000 1.2 +++ entry.S 10 Jun 2003 01:45:55 -0000 1.3 @@ -622,6 +622,18 @@ .long SYMBOL_NAME(sys_ni_syscall) /* Reserved for Security */ .long SYMBOL_NAME(sys_gettid) .long SYMBOL_NAME(sys_readahead) /* 225 */ + .long SYMBOL_NAME(sys_ni_syscall) /* reserved for setxattr */ + .long SYMBOL_NAME(sys_ni_syscall) /* reserved for lsetxattr */ + .long SYMBOL_NAME(sys_ni_syscall) /* reserved for fsetxattr */ + .long SYMBOL_NAME(sys_ni_syscall) /* reserved for getxattr */ + .long SYMBOL_NAME(sys_ni_syscall) /* 230 reserved for lgetxattr */ + .long SYMBOL_NAME(sys_ni_syscall) /* reserved for fgetxattr */ + .long SYMBOL_NAME(sys_ni_syscall) /* reserved for listxattr */ + .long SYMBOL_NAME(sys_ni_syscall) /* reserved for llistxattr */ + .long SYMBOL_NAME(sys_ni_syscall) /* reserved for flistxattr */ + .long SYMBOL_NAME(sys_ni_syscall) /* 235 reserved for removexattr */ + .long SYMBOL_NAME(sys_ni_syscall) /* reserved for lremovexattr */ + .long SYMBOL_NAME(sys_ni_syscall) /* reserved for fremovexattr */ .rept NR_syscalls-(.-sys_call_table)/4 .long SYMBOL_NAME(sys_ni_syscall) Index: head.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/i386/kernel/head.S,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- head.S 10 Apr 2002 14:23:20 -0000 1.2 +++ head.S 10 Jun 2003 01:45:55 -0000 1.3 @@ -446,12 +446,3 @@ .quad 0x00009a0000000000 /* 0x50 APM CS 16 code (16 bit) */ .quad 0x0040920000000000 /* 0x58 APM DS data */ .fill NR_CPUS*4,8,0 /* space for TSS's and LDT's */ - -/* - * This is to aid debugging, the various locking macros will be putting - * code fragments here. When an oops occurs we'd rather know that it's - * inside the .text.lock section rather than as some offset from whatever - * function happens to be last in the .text segment. - */ -.section .text.lock -ENTRY(stext_lock) Index: i386_ksyms.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/i386/kernel/i386_ksyms.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- i386_ksyms.c 10 Apr 2002 14:23:20 -0000 1.2 +++ i386_ksyms.c 10 Jun 2003 01:45:55 -0000 1.3 @@ -35,6 +35,8 @@ #if defined(CONFIG_APM) || defined(CONFIG_APM_MODULE) extern void machine_real_restart(unsigned char *, int); EXPORT_SYMBOL(machine_real_restart); +extern void default_idle(void); +EXPORT_SYMBOL(default_idle); #endif #ifdef CONFIG_SMP @@ -93,7 +95,6 @@ EXPORT_SYMBOL(strtok); EXPORT_SYMBOL(strpbrk); -EXPORT_SYMBOL(simple_strtol); EXPORT_SYMBOL(strstr); EXPORT_SYMBOL(strncpy_from_user); Index: pci-irq.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/i386/kernel/pci-irq.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- pci-irq.c 10 Apr 2002 14:23:21 -0000 1.2 +++ pci-irq.c 10 Jun 2003 01:45:55 -0000 1.3 @@ -225,12 +225,12 @@ */ static int pirq_cyrix_get(struct pci_dev *router, struct pci_dev *dev, int pirq) { - return read_config_nybble(router, 0x5C, pirq-1); + return read_config_nybble(router, 0x5C, (pirq-1)^1); } static int pirq_cyrix_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) { - write_config_nybble(router, 0x5C, pirq-1, irq); + write_config_nybble(router, 0x5C, (pirq-1)^1, irq); return 1; } Index: pci-pc.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/i386/kernel/pci-pc.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- pci-pc.c 10 Jun 2003 01:13:14 -0000 1.3 +++ pci-pc.c 10 Jun 2003 01:45:56 -0000 1.4 @@ -1109,22 +1109,29 @@ } /* - * Nobody seems to know what this does. Damn. + * Addresses issues with problems in the memory write queue timer in + * certain VIA Northbridges. This bugfix is per VIA's specifications. * - * But it does seem to fix some unspecified problem - * with 'movntq' copies on Athlons. - * - * VIA 8363 chipset: - * - bit 7 at offset 0x55: Debug (RW) + * VIA 8363,8622,8361 Northbridges: + * - bits 5, 6, 7 at offset 0x55 need to be turned off + * VIA 8367 (KT266x) Northbridges: + * - bits 5, 6, 7 at offset 0x95 need to be turned off */ -static void __init pci_fixup_via_athlon_bug(struct pci_dev *d) +static void __init pci_fixup_via_northbridge_bug(struct pci_dev *d) { u8 v; - pci_read_config_byte(d, 0x55, &v); - if (v & 0x80) { - printk("Trying to stomp on Athlon bug...\n"); - v &= 0x7f; /* clear bit 55.7 */ - pci_write_config_byte(d, 0x55, v); + int where = 0x55; + + if (d->device == PCI_DEVICE_ID_VIA_8367_0) { + where = 0x95; /* the memory write queue timer register is + different for the kt266x's: 0x95 not 0x55 */ + } + + pci_read_config_byte(d, where, &v); + if (v & 0xe0) { + printk("Disabling VIA memory write queue: [%02x] %02x->%02x\n", where, v, v & 0x1f); + v &= 0x1f; /* clear bits 5, 6, 7 */ + pci_write_config_byte(d, where, v); } } @@ -1137,7 +1144,10 @@ { PCI_FIXUP_HEADER, PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_5597, pci_fixup_latency }, { PCI_FIXUP_HEADER, PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_5598, pci_fixup_latency }, { PCI_FIXUP_HEADER, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3, pci_fixup_piix4_acpi }, - { PCI_FIXUP_HEADER, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8363_0, pci_fixup_via_athlon_bug }, + { PCI_FIXUP_HEADER, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8363_0, pci_fixup_via_northbridge_bug }, + { PCI_FIXUP_HEADER, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8622, pci_fixup_via_northbridge_bug }, + { PCI_FIXUP_HEADER, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8361, pci_fixup_via_northbridge_bug }, + { PCI_FIXUP_HEADER, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8367_0, pci_fixup_via_northbridge_bug }, { 0 } }; Index: process.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/i386/kernel/process.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- process.c 10 Apr 2002 14:23:21 -0000 1.2 +++ process.c 10 Jun 2003 01:45:56 -0000 1.3 @@ -41,6 +41,7 @@ #include <asm/ldt.h> #include <asm/processor.h> #include <asm/i387.h> +#include <asm/irq.h> #include <asm/desc.h> #include <asm/mmu_context.h> #ifdef CONFIG_MATH_EMULATION @@ -77,7 +78,7 @@ * We use this if we don't have any better * idle routine.. */ -static void default_idle(void) +void default_idle(void) { if (current_cpu_data.hlt_works_ok && !hlt_counter) { __cli(); @@ -542,6 +543,8 @@ BUG(); } } + + release_x86_irqs(dead_task); } /* Index: setup.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/i386/kernel/setup.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- setup.c 10 Jun 2003 01:13:14 -0000 1.3 +++ setup.c 10 Jun 2003 01:45:56 -0000 1.4 @@ -827,10 +827,8 @@ #define PFN_PHYS(x) ((x) << PAGE_SHIFT) /* - * 128MB for vmalloc and initrd + * Reserved space for vmalloc and iomap - defined in asm/page.h */ -#define VMALLOC_RESERVE (unsigned long)(128 << 20) -#define MAXMEM (unsigned long)(-PAGE_OFFSET-VMALLOC_RESERVE) #define MAXMEM_PFN PFN_DOWN(MAXMEM) #define MAX_NONPAE_PFN (1 << 20) @@ -2234,7 +2232,7 @@ */ #define NR_SIBLINGS 2 if (smp_num_siblings != NR_SIBLINGS) { - printk(KERN_WARNING "CPU: Unsuppored number of the siblings %d", smp_num_siblings); + printk(KERN_WARNING "CPU: Unsupported number of the siblings %d", smp_num_siblings); smp_num_siblings = 1; goto too_many_siblings; } Index: signal.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/i386/kernel/signal.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- signal.c 10 Apr 2002 14:23:21 -0000 1.2 +++ signal.c 10 Jun 2003 01:45:56 -0000 1.3 @@ -28,7 +28,7 @@ #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) -asmlinkage int FASTCALL(do_signal(struct pt_regs *regs, sigset_t *oldset)); +int FASTCALL(do_signal(struct pt_regs *regs, sigset_t *oldset)); int copy_siginfo_to_user(siginfo_t *to, siginfo_t *from) { Index: time.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/i386/kernel/time.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- time.c 10 Apr 2002 14:23:21 -0000 1.2 +++ time.c 10 Jun 2003 01:45:56 -0000 1.3 @@ -681,7 +681,6 @@ #ifndef do_gettimeoffset do_gettimeoffset = do_fast_gettimeoffset; #endif - do_get_fast_time = do_gettimeofday; /* report CPU clock rate in Hz. * The formula is (10^6 * 2^32) / (2^32 * 1 / (clocks/us)) = Index: vm86.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/i386/kernel/vm86.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- vm86.c 10 Apr 2002 14:23:21 -0000 1.2 +++ vm86.c 10 Jun 2003 01:45:56 -0000 1.3 @@ -16,6 +16,7 @@ #include <asm/uaccess.h> #include <asm/pgalloc.h> #include <asm/io.h> +#include <asm/irq.h> /* * Known problems: @@ -62,7 +63,7 @@ ( (unsigned)( & (((struct kernel_vm86_regs *)0)->VM86_REGS_PART2) ) ) #define VM86_REGS_SIZE2 (sizeof(struct kernel_vm86_regs) - VM86_REGS_SIZE1) -asmlinkage struct pt_regs * FASTCALL(save_v86_state(struct kernel_vm86_regs * regs)); +struct pt_regs * FASTCALL(save_v86_state(struct kernel_vm86_regs * regs)); struct pt_regs * save_v86_state(struct kernel_vm86_regs * regs) { struct tss_struct *tss; @@ -610,6 +611,14 @@ } read_unlock(&tasklist_lock); return ret; +} + +void release_x86_irqs(struct task_struct *task) +{ + int i; + for (i=3; i<16; i++) + if (vm86_irqs[i].tsk == task) + free_vm86_irq(i); } static inline void handle_irq_zombies(void) |