Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 12080
b: refs/heads/master
c: ef0eaa1
h: refs/heads/master
v: v3
  • Loading branch information
Steve French committed Nov 1, 2005
1 parent 03ddefd commit ce33ba6
Show file tree
Hide file tree
Showing 20 changed files with 213 additions and 130 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 53b2ec5518aa2623e8c0cb36f1c304a797988a46
refs/heads/master: ef0eaa13362041f531f951b89362bfbc177e2bc0
5 changes: 0 additions & 5 deletions trunk/arch/i386/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1042,8 +1042,3 @@ config X86_TRAMPOLINE
bool
depends on X86_SMP || (X86_VOYAGER && SMP)
default y

config PC
bool
depends on X86 && !EMBEDDED
default y
77 changes: 16 additions & 61 deletions trunk/arch/i386/kernel/apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,6 @@ static int __init detect_init_APIC (void)

void __init init_apic_mappings(void)
{
unsigned int orig_apicid;
unsigned long apic_phys;

/*
Expand All @@ -825,11 +824,8 @@ void __init init_apic_mappings(void)
* Fetch the APIC ID of the BSP in case we have a
* default configuration (or the MP table is broken).
*/
orig_apicid = boot_cpu_physical_apicid;
boot_cpu_physical_apicid = GET_APIC_ID(apic_read(APIC_ID));
if ((orig_apicid != -1U) && (orig_apicid != boot_cpu_physical_apicid))
printk(KERN_WARNING "Boot APIC ID in local APIC unexpected (%d vs %d)",
orig_apicid, boot_cpu_physical_apicid);
if (boot_cpu_physical_apicid == -1U)
boot_cpu_physical_apicid = GET_APIC_ID(apic_read(APIC_ID));

#ifdef CONFIG_X86_IO_APIC
{
Expand Down Expand Up @@ -1259,81 +1255,40 @@ fastcall void smp_error_interrupt(struct pt_regs *regs)
}

/*
* This initializes the IO-APIC and APIC hardware.
* This initializes the IO-APIC and APIC hardware if this is
* a UP kernel.
*/
int __init APIC_init(void)
int __init APIC_init_uniprocessor (void)
{
if (enable_local_apic < 0) {
printk(KERN_INFO "APIC disabled\n");
return -1;
}
if (enable_local_apic < 0)
clear_bit(X86_FEATURE_APIC, boot_cpu_data.x86_capability);

/* See if we have a SMP configuration or have forced enabled
* the local apic.
*/
if (!smp_found_config && !acpi_lapic && !cpu_has_apic) {
enable_local_apic = -1;
if (!smp_found_config && !cpu_has_apic)
return -1;
}

/*
* Complain if the BIOS pretends there is an apic.
* Then get out because we don't have an a local apic.
* Complain if the BIOS pretends there is one.
*/
if (!cpu_has_apic && APIC_INTEGRATED(apic_version[boot_cpu_physical_apicid])) {
printk(KERN_ERR "BIOS bug, local APIC #%d not detected!...\n",
boot_cpu_physical_apicid);
printk(KERN_ERR "... forcing use of dummy APIC emulation. (tell your hw vendor)\n");
enable_local_apic = -1;
return -1;
}

verify_local_APIC();

/*
* Should not be necessary because the MP table should list the boot
* CPU too, but we do it for the sake of robustness anyway.
* Makes no sense to do this check in clustered apic mode, so skip it
*/
if (!check_phys_apicid_present(boot_cpu_physical_apicid)) {
printk("weird, boot CPU (#%d) not listed by the BIOS.\n",
boot_cpu_physical_apicid);
physid_set(boot_cpu_physical_apicid, phys_cpu_present_map);
}

/*
* Switch from PIC to APIC mode.
*/
connect_bsp_APIC();
setup_local_APIC();

#ifdef CONFIG_X86_IO_APIC
/*
* Now start the IO-APICs
*/
if (smp_found_config && !skip_ioapic_setup && nr_ioapics)
setup_IO_APIC();
#endif
return 0;
}
phys_cpu_present_map = physid_mask_of_physid(boot_cpu_physical_apicid);

void __init APIC_late_time_init(void)
{
/* Improve our loops per jiffy estimate */
loops_per_jiffy = ((1000 + HZ - 1)/HZ)*cpu_khz;
boot_cpu_data.loops_per_jiffy = loops_per_jiffy;
cpu_data[0].loops_per_jiffy = loops_per_jiffy;

/* setup_apic_nmi_watchdog doesn't work properly before cpu_khz is
* initialized. So redo it here to ensure the boot cpu is setup
* properly.
*/
if (nmi_watchdog == NMI_LOCAL_APIC)
setup_apic_nmi_watchdog();
setup_local_APIC();

#ifdef CONFIG_X86_IO_APIC
if (smp_found_config && !skip_ioapic_setup && nr_ioapics)
IO_APIC_late_time_init();
if (smp_found_config)
if (!skip_ioapic_setup && nr_ioapics)
setup_IO_APIC();
#endif
setup_boot_APIC_clock();

return 0;
}
4 changes: 0 additions & 4 deletions trunk/arch/i386/kernel/i8259.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,4 @@ void __init init_IRQ(void)
setup_irq(FPU_IRQ, &fpu_irq);

irq_ctx_init(smp_processor_id());

#ifdef CONFIG_X86_LOCAL_APIC
APIC_init();
#endif
}
6 changes: 1 addition & 5 deletions trunk/arch/i386/kernel/io_apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -2387,15 +2387,11 @@ void __init setup_IO_APIC(void)
sync_Arb_IDs();
setup_IO_APIC_irqs();
init_IO_APIC_traps();
check_timer();
if (!acpi_ioapic)
print_IO_APIC();
}

void __init IO_APIC_late_time_init(void)
{
check_timer();
}

/*
* Called after all the initialization is done. If we didnt find any
* APIC bugs then we can allow the modify fast path
Expand Down
68 changes: 52 additions & 16 deletions trunk/arch/i386/kernel/smpboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -1078,16 +1078,6 @@ void *xquad_portio;
EXPORT_SYMBOL(xquad_portio);
#endif

/*
* Fall back to non SMP mode after errors.
*
*/
static __init void disable_smp(void)
{
cpu_set(0, cpu_sibling_map[0]);
cpu_set(0, cpu_core_map[0]);
}

static void __init smp_boot_cpus(unsigned int max_cpus)
{
int apicid, cpu, bit, kicked;
Expand All @@ -1100,6 +1090,7 @@ static void __init smp_boot_cpus(unsigned int max_cpus)
printk("CPU%d: ", 0);
print_cpu_info(&cpu_data[0]);

boot_cpu_physical_apicid = GET_APIC_ID(apic_read(APIC_ID));
boot_cpu_logical_apicid = logical_smp_processor_id();
x86_cpu_to_apicid[0] = boot_cpu_physical_apicid;

Expand All @@ -1111,27 +1102,68 @@ static void __init smp_boot_cpus(unsigned int max_cpus)
cpus_clear(cpu_core_map[0]);
cpu_set(0, cpu_core_map[0]);

map_cpu_to_logical_apicid();

/*
* If we couldn't find an SMP configuration at boot time,
* get out of here now!
*/
if (!smp_found_config && !acpi_lapic) {
printk(KERN_NOTICE "SMP motherboard not detected.\n");
disable_smp();
smpboot_clear_io_apic_irqs();
phys_cpu_present_map = physid_mask_of_physid(0);
if (APIC_init_uniprocessor())
printk(KERN_NOTICE "Local APIC not detected."
" Using dummy APIC emulation.\n");
map_cpu_to_logical_apicid();
cpu_set(0, cpu_sibling_map[0]);
cpu_set(0, cpu_core_map[0]);
return;
}

/*
* Should not be necessary because the MP table should list the boot
* CPU too, but we do it for the sake of robustness anyway.
* Makes no sense to do this check in clustered apic mode, so skip it
*/
if (!check_phys_apicid_present(boot_cpu_physical_apicid)) {
printk("weird, boot CPU (#%d) not listed by the BIOS.\n",
boot_cpu_physical_apicid);
physid_set(hard_smp_processor_id(), phys_cpu_present_map);
}

/*
* If we couldn't find a local APIC, then get out of here now!
*/
if (APIC_INTEGRATED(apic_version[boot_cpu_physical_apicid]) && !cpu_has_apic) {
printk(KERN_ERR "BIOS bug, local APIC #%d not detected!...\n",
boot_cpu_physical_apicid);
printk(KERN_ERR "... forcing use of dummy APIC emulation. (tell your hw vendor)\n");
smpboot_clear_io_apic_irqs();
phys_cpu_present_map = physid_mask_of_physid(0);
cpu_set(0, cpu_sibling_map[0]);
cpu_set(0, cpu_core_map[0]);
return;
}

verify_local_APIC();

/*
* If SMP should be disabled, then really disable it!
*/
if (!max_cpus || (enable_local_apic < 0)) {
printk(KERN_INFO "SMP mode deactivated.\n");
disable_smp();
if (!max_cpus) {
smp_found_config = 0;
printk(KERN_INFO "SMP mode deactivated, forcing use of dummy APIC emulation.\n");
smpboot_clear_io_apic_irqs();
phys_cpu_present_map = physid_mask_of_physid(0);
cpu_set(0, cpu_sibling_map[0]);
cpu_set(0, cpu_core_map[0]);
return;
}

connect_bsp_APIC();
setup_local_APIC();
map_cpu_to_logical_apicid();


setup_portio_remap();

/*
Expand Down Expand Up @@ -1212,6 +1244,10 @@ static void __init smp_boot_cpus(unsigned int max_cpus)
cpu_set(0, cpu_sibling_map[0]);
cpu_set(0, cpu_core_map[0]);

smpboot_setup_io_apic();

setup_boot_APIC_clock();

/*
* Synchronize the TSC with the AP
*/
Expand Down
12 changes: 1 addition & 11 deletions trunk/arch/i386/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,8 @@ static int time_init_device(void)

device_initcall(time_init_device);

extern void (*late_time_init)(void);
#ifdef CONFIG_HPET_TIMER
extern void (*late_time_init)(void);
/* Duplicate of time_init() below, with hpet_enable part added */
static void __init hpet_time_init(void)
{
Expand All @@ -458,11 +458,6 @@ static void __init hpet_time_init(void)
printk(KERN_INFO "Using %s for high-res timesource\n",cur_timer->name);

time_init_hook();

#ifdef CONFIG_X86_LOCAL_APIC
if (enable_local_apic >= 0)
APIC_late_time_init();
#endif
}
#endif

Expand All @@ -487,9 +482,4 @@ void __init time_init(void)
printk(KERN_INFO "Using %s for high-res timesource\n",cur_timer->name);

time_init_hook();

#ifdef CONFIG_X86_LOCAL_APIC
if (enable_local_apic >= 0)
late_time_init = APIC_late_time_init;
#endif
}
4 changes: 2 additions & 2 deletions trunk/drivers/input/keyboard/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ menuconfig INPUT_KEYBOARD
if INPUT_KEYBOARD

config KEYBOARD_ATKBD
tristate "AT keyboard" if !PC
tristate "AT keyboard" if !X86_PC
default y
select SERIO
select SERIO_LIBPS2
select SERIO_I8042 if PC
select SERIO_I8042 if X86_PC
select SERIO_GSCPS2 if GSC
help
Say Y here if you want to use a standard AT or PS/2 keyboard. Usually
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/input/mouse/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ config MOUSE_PS2
default y
select SERIO
select SERIO_LIBPS2
select SERIO_I8042 if PC
select SERIO_I8042 if X86_PC
select SERIO_GSCPS2 if GSC
---help---
Say Y here if you have a PS/2 mouse connected to your system. This
Expand Down
44 changes: 32 additions & 12 deletions trunk/drivers/scsi/ide-scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,22 @@ static void idescsi_input_buffers (ide_drive_t *drive, idescsi_pc_t *pc, unsigne
return;
}
count = min(pc->sg->length - pc->b_count, bcount);
buf = kmap_atomic(pc->sg->page, KM_IRQ0);
drive->hwif->atapi_input_bytes(drive,
buf + pc->b_count + pc->sg->offset, count);
kunmap_atomic(buf, KM_IRQ0);
bcount -= count;
pc->b_count += count;
if (PageHighMem(pc->sg->page)) {
unsigned long flags;

local_irq_save(flags);
buf = kmap_atomic(pc->sg->page, KM_IRQ0) +
pc->sg->offset;
drive->hwif->atapi_input_bytes(drive,
buf + pc->b_count, count);
kunmap_atomic(buf - pc->sg->offset, KM_IRQ0);
local_irq_restore(flags);
} else {
buf = page_address(pc->sg->page) + pc->sg->offset;
drive->hwif->atapi_input_bytes(drive,
buf + pc->b_count, count);
}
bcount -= count; pc->b_count += count;
if (pc->b_count == pc->sg->length) {
pc->sg++;
pc->b_count = 0;
Expand All @@ -205,12 +215,22 @@ static void idescsi_output_buffers (ide_drive_t *drive, idescsi_pc_t *pc, unsign
return;
}
count = min(pc->sg->length - pc->b_count, bcount);
buf = kmap_atomic(pc->sg->page, KM_IRQ0);
drive->hwif->atapi_output_bytes(drive,
buf + pc->b_count + pc->sg->offset, count);
kunmap_atomic(buf, KM_IRQ0);
bcount -= count;
pc->b_count += count;
if (PageHighMem(pc->sg->page)) {
unsigned long flags;

local_irq_save(flags);
buf = kmap_atomic(pc->sg->page, KM_IRQ0) +
pc->sg->offset;
drive->hwif->atapi_output_bytes(drive,
buf + pc->b_count, count);
kunmap_atomic(buf - pc->sg->offset, KM_IRQ0);
local_irq_restore(flags);
} else {
buf = page_address(pc->sg->page) + pc->sg->offset;
drive->hwif->atapi_output_bytes(drive,
buf + pc->b_count, count);
}
bcount -= count; pc->b_count += count;
if (pc->b_count == pc->sg->length) {
pc->sg++;
pc->b_count = 0;
Expand Down
Loading

0 comments on commit ce33ba6

Please sign in to comment.