From 58db75841d817491bb4e707d2396466661f2bcc8 Mon Sep 17 00:00:00 2001 From: Steve Passe Date: Fri, 27 Jun 1997 23:48:05 +0000 Subject: [PATCH] apic_vector.s: - added Xcpustop IPI code to support stop_cpus()/restart_cpus(). it is off by default, enable via smptests.h:TEST_CPUSTOP intr_machdep.h: - moved +ICULEN to lower level. - added entry for Xcpustop. --- sys/amd64/amd64/apic_vector.S | 77 ++++++++++++++++++++++++++++++++++- sys/amd64/isa/intr_machdep.h | 11 ++++- sys/i386/i386/apic_vector.s | 77 ++++++++++++++++++++++++++++++++++- sys/i386/isa/apic_vector.s | 77 ++++++++++++++++++++++++++++++++++- sys/i386/isa/intr_machdep.h | 11 ++++- 5 files changed, 246 insertions(+), 7 deletions(-) diff --git a/sys/amd64/amd64/apic_vector.S b/sys/amd64/amd64/apic_vector.S index fa7edb027ed4..debc24961223 100644 --- a/sys/amd64/amd64/apic_vector.S +++ b/sys/amd64/amd64/apic_vector.S @@ -1,9 +1,11 @@ /* * from: vector.s, 386BSD 0.1 unknown origin - * $Id: apic_vector.s,v 1.2 1997/05/31 08:59:51 peter Exp $ + * $Id: apic_vector.s,v 1.1 1997/06/26 17:52:12 smp Exp smp $ */ +#include /** TEST_CPUSTOP */ + /* convert an absolute IRQ# into a bitmask */ #define IRQ_BIT(irq_num) (1 << (irq_num)) @@ -178,6 +180,69 @@ _Xinvltlb: popl %eax iret +#ifdef TEST_CPUSTOP +/* + * Executed by a CPU when it receives an Xcpustop IPI from another CPU, + * + * - Signals its receipt. + * - Waits for permission to restart. + * - Signals its restart. + */ + + .text + SUPERALIGN_TEXT + .globl _Xcpustop +_Xcpustop: + pushl %eax + pushl %ds /* save current data segment */ + +#ifdef DEBUG_CPUSTOP + movb $0x50, %al + outb %al, $POST_ADDR +#endif + + movl $KDSEL, %eax + movl %ax, %ds /* use KERNEL data segment */ + + movl _cpuid, %eax /* id */ + + lock + btsl %eax, _stopped_cpus /* stopped_cpus |= (1< /** TEST_CPUSTOP */ + /* convert an absolute IRQ# into a bitmask */ #define IRQ_BIT(irq_num) (1 << (irq_num)) @@ -178,6 +180,69 @@ _Xinvltlb: popl %eax iret +#ifdef TEST_CPUSTOP +/* + * Executed by a CPU when it receives an Xcpustop IPI from another CPU, + * + * - Signals its receipt. + * - Waits for permission to restart. + * - Signals its restart. + */ + + .text + SUPERALIGN_TEXT + .globl _Xcpustop +_Xcpustop: + pushl %eax + pushl %ds /* save current data segment */ + +#ifdef DEBUG_CPUSTOP + movb $0x50, %al + outb %al, $POST_ADDR +#endif + + movl $KDSEL, %eax + movl %ax, %ds /* use KERNEL data segment */ + + movl _cpuid, %eax /* id */ + + lock + btsl %eax, _stopped_cpus /* stopped_cpus |= (1< /** TEST_CPUSTOP */ + /* convert an absolute IRQ# into a bitmask */ #define IRQ_BIT(irq_num) (1 << (irq_num)) @@ -178,6 +180,69 @@ _Xinvltlb: popl %eax iret +#ifdef TEST_CPUSTOP +/* + * Executed by a CPU when it receives an Xcpustop IPI from another CPU, + * + * - Signals its receipt. + * - Waits for permission to restart. + * - Signals its restart. + */ + + .text + SUPERALIGN_TEXT + .globl _Xcpustop +_Xcpustop: + pushl %eax + pushl %ds /* save current data segment */ + +#ifdef DEBUG_CPUSTOP + movb $0x50, %al + outb %al, $POST_ADDR +#endif + + movl $KDSEL, %eax + movl %ax, %ds /* use KERNEL data segment */ + + movl _cpuid, %eax /* id */ + + lock + btsl %eax, _stopped_cpus /* stopped_cpus |= (1<