From d157b3e43914d943462f70389c4f5d73f84b6c71 Mon Sep 17 00:00:00 2001 From: fsmp Date: Sun, 6 Jul 1997 23:40:15 +0000 Subject: [PATCH] Additional debugging functions and macros. "spurious INTerrupt" support. --- sys/amd64/include/smp.h | 14 +++++++++++-- sys/i386/include/smp.h | 14 +++++++++++-- sys/i386/include/smptests.h | 39 +++++++++++++++++++++++++++++++++++-- sys/sys/smp.h | 14 +++++++++++-- 4 files changed, 73 insertions(+), 8 deletions(-) diff --git a/sys/amd64/include/smp.h b/sys/amd64/include/smp.h index 8236b91a491c..a6d164c88685 100644 --- a/sys/amd64/include/smp.h +++ b/sys/amd64/include/smp.h @@ -6,7 +6,7 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * $Id: smp.h,v 1.12 1997/06/25 20:59:15 fsmp Exp $ + * $Id: smp.h,v 1.5 1997/07/06 23:36:49 smp Exp smp $ * */ @@ -27,8 +27,18 @@ /* * For sending values to POST displays. + * XXX FIXME: where does this really belong, isa.h/isa.c perhaps? */ -#define POSTCODE(X) outb(0x80, (X)) +extern int current_postcode; /** XXX currently in mp_machdep.c */ +#define POSTCODE(X) current_postcode = (X), \ + outb(0x80, current_postcode) +#define POSTCODE_LO(X) current_postcode &= 0xf0, \ + current_postcode |= ((X) & 0x0f), \ + outb(0x80, current_postcode) +#define POSTCODE_HI(X) current_postcode &= 0x0f, \ + current_postcode |= (((X) << 4) & 0xf0), \ + outb(0x80, current_postcode) + #include diff --git a/sys/i386/include/smp.h b/sys/i386/include/smp.h index 8236b91a491c..a6d164c88685 100644 --- a/sys/i386/include/smp.h +++ b/sys/i386/include/smp.h @@ -6,7 +6,7 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * $Id: smp.h,v 1.12 1997/06/25 20:59:15 fsmp Exp $ + * $Id: smp.h,v 1.5 1997/07/06 23:36:49 smp Exp smp $ * */ @@ -27,8 +27,18 @@ /* * For sending values to POST displays. + * XXX FIXME: where does this really belong, isa.h/isa.c perhaps? */ -#define POSTCODE(X) outb(0x80, (X)) +extern int current_postcode; /** XXX currently in mp_machdep.c */ +#define POSTCODE(X) current_postcode = (X), \ + outb(0x80, current_postcode) +#define POSTCODE_LO(X) current_postcode &= 0xf0, \ + current_postcode |= ((X) & 0x0f), \ + outb(0x80, current_postcode) +#define POSTCODE_HI(X) current_postcode &= 0x0f, \ + current_postcode |= (((X) << 4) & 0xf0), \ + outb(0x80, current_postcode) + #include diff --git a/sys/i386/include/smptests.h b/sys/i386/include/smptests.h index a95800584e62..234c19a85253 100644 --- a/sys/i386/include/smptests.h +++ b/sys/i386/include/smptests.h @@ -22,7 +22,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: smptests.h,v 1.1 1997/06/26 18:02:47 smp Exp smp $ + * $Id: smptests.h,v 1.4 1997/07/06 23:36:49 smp Exp smp $ */ #ifndef _MACHINE_SMPTESTS_H_ @@ -33,12 +33,47 @@ * various 'tests in progress' */ -/* address of POST hardware port */ +/* + * address of POST hardware port + * #define POST_ADDR 0x80 + */ +#ifdef POST_ADDR +/* + * Overwrite the current_postcode low nibble . + */ +#define ASMPOSTCODE_LO(X) \ + movl _current_postcode, %eax ; \ + andl $0xf0, %eax ; \ + orl $X, %eax ; \ + outb %al, $POST_ADDR + +/* + * Overwrite the current_postcode high nibble . + * Note: this does NOT shift the digit to the high position! + */ +#define ASMPOSTCODE_HI(X) \ + movl _current_postcode, %eax ; \ + andl $0x0f, %eax ; \ + orl $X, %eax ; \ + outb %al, $POST_ADDR +#else +#define ASMPOSTCODE_LO(X) +#define ASMPOSTCODE_HI(X) +#endif /* POST_ADDR */ + + +/* + * misc. counters + * +#define COUNT_XINVLTLB_HITS +#define COUNT_SPURIOUS_INTS + */ /* * IPI for stop/restart of other CPUs + * #define TEST_CPUSTOP #define DEBUG_CPUSTOP */ diff --git a/sys/sys/smp.h b/sys/sys/smp.h index 8236b91a491c..a6d164c88685 100644 --- a/sys/sys/smp.h +++ b/sys/sys/smp.h @@ -6,7 +6,7 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * $Id: smp.h,v 1.12 1997/06/25 20:59:15 fsmp Exp $ + * $Id: smp.h,v 1.5 1997/07/06 23:36:49 smp Exp smp $ * */ @@ -27,8 +27,18 @@ /* * For sending values to POST displays. + * XXX FIXME: where does this really belong, isa.h/isa.c perhaps? */ -#define POSTCODE(X) outb(0x80, (X)) +extern int current_postcode; /** XXX currently in mp_machdep.c */ +#define POSTCODE(X) current_postcode = (X), \ + outb(0x80, current_postcode) +#define POSTCODE_LO(X) current_postcode &= 0xf0, \ + current_postcode |= ((X) & 0x0f), \ + outb(0x80, current_postcode) +#define POSTCODE_HI(X) current_postcode &= 0x0f, \ + current_postcode |= (((X) << 4) & 0xf0), \ + outb(0x80, current_postcode) + #include