diff options
author | Dale Rahn <drahn@cvs.openbsd.org> | 2003-04-17 03:42:15 +0000 |
---|---|---|
committer | Dale Rahn <drahn@cvs.openbsd.org> | 2003-04-17 03:42:15 +0000 |
commit | d36015cb7ad92f7024a5754fc18618f0b0e13139 (patch) | |
tree | f134d2cf17198d6d3a9b68105527ee84adb387e4 /sys | |
parent | ddb3879f13964f6a99cf09d238b853194cbab068 (diff) |
i386 changes to move to ELF. asm cleanup. Change MAXDSIZ to 512M for 1Gsep.
DARPA funded work.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/i386/conf/Makefile.i386 | 6 | ||||
-rw-r--r-- | sys/arch/i386/i386/apmcall.S | 4 | ||||
-rw-r--r-- | sys/arch/i386/i386/bios.c | 4 | ||||
-rw-r--r-- | sys/arch/i386/i386/db_magic.s | 20 | ||||
-rw-r--r-- | sys/arch/i386/i386/in_cksum.s | 6 | ||||
-rw-r--r-- | sys/arch/i386/i386/linux_machdep.c | 6 | ||||
-rw-r--r-- | sys/arch/i386/i386/locore.s | 65 | ||||
-rw-r--r-- | sys/arch/i386/i386/microtime.s | 18 | ||||
-rw-r--r-- | sys/arch/i386/i386/random.s | 12 | ||||
-rw-r--r-- | sys/arch/i386/i386/svr4_machdep.c | 6 | ||||
-rw-r--r-- | sys/arch/i386/include/asm.h | 27 | ||||
-rw-r--r-- | sys/arch/i386/include/bus.h | 18 | ||||
-rw-r--r-- | sys/arch/i386/include/cdefs.h | 35 | ||||
-rw-r--r-- | sys/arch/i386/include/db_machdep.h | 4 | ||||
-rw-r--r-- | sys/arch/i386/include/exec.h | 19 | ||||
-rw-r--r-- | sys/arch/i386/include/intr.h | 5 | ||||
-rw-r--r-- | sys/arch/i386/include/loadfile_machdep.h | 59 | ||||
-rw-r--r-- | sys/arch/i386/include/param.h | 8 | ||||
-rw-r--r-- | sys/arch/i386/include/reloc.h | 50 | ||||
-rw-r--r-- | sys/arch/i386/include/vmparam.h | 4 | ||||
-rw-r--r-- | sys/arch/i386/isa/icu.s | 8 | ||||
-rw-r--r-- | sys/arch/i386/isa/npx.c | 12 | ||||
-rw-r--r-- | sys/arch/i386/isa/vector.s | 84 | ||||
-rw-r--r-- | sys/arch/i386/pci/pcibios.c | 10 |
24 files changed, 297 insertions, 193 deletions
diff --git a/sys/arch/i386/conf/Makefile.i386 b/sys/arch/i386/conf/Makefile.i386 index e5a3e175b93..b45f0fe7471 100644 --- a/sys/arch/i386/conf/Makefile.i386 +++ b/sys/arch/i386/conf/Makefile.i386 @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.i386,v 1.33 2002/12/25 21:10:26 miod Exp $ +# $OpenBSD: Makefile.i386,v 1.34 2003/04/17 03:42:09 drahn Exp $ # $NetBSD: Makefile.i386,v 1.67 1996/05/11 16:12:11 mycroft Exp $ # Makefile for OpenBSD @@ -49,8 +49,8 @@ CMACHFLAGS+= -fno-stack-protector COPTS?= -O2 CFLAGS= ${DEBUG} ${CDIAGFLAGS} ${CMACHFLAGS} ${COPTS} ${PIPE} AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE -LINKFLAGS= -z -Ttext D0100000 -e start -STRIPFLAGS= -d +LINKFLAGS= -Ttext 0xD0100120 -e start -N +STRIPFLAGS= -g -X -x HOSTCC= ${CC} HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//} diff --git a/sys/arch/i386/i386/apmcall.S b/sys/arch/i386/i386/apmcall.S index a72ddc868c5..ca56eb5c5d3 100644 --- a/sys/arch/i386/i386/apmcall.S +++ b/sys/arch/i386/i386/apmcall.S @@ -1,4 +1,4 @@ -/* $OpenBSD: apmcall.S,v 1.3 2001/06/29 22:22:45 mickey Exp $ */ +/* $OpenBSD: apmcall.S,v 1.4 2003/04/17 03:42:14 drahn Exp $ */ /* * Copyright (c) 2000,2001 Michael Shalayeff @@ -79,7 +79,7 @@ ENTRY(apmcall) movl 8(%ebp), %eax clc - lcall %cs:(_C_LABEL(apm_ep)) + lcall %cs:*(_C_LABEL(apm_ep)) pushl %eax setc %al movzbl %al, %esi diff --git a/sys/arch/i386/i386/bios.c b/sys/arch/i386/i386/bios.c index e5cff420edb..062089c3fc1 100644 --- a/sys/arch/i386/i386/bios.c +++ b/sys/arch/i386/i386/bios.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bios.c,v 1.49 2002/05/20 16:38:01 mickey Exp $ */ +/* $OpenBSD: bios.c,v 1.50 2003/04/17 03:42:14 drahn Exp $ */ /* * Copyright (c) 1997-2001 Michael Shalayeff @@ -388,7 +388,7 @@ bios32_service(service, e, ei) return 0; base = 0; - __asm __volatile("lcall (%4)" + __asm __volatile("lcall *(%4)" : "+a" (service), "+b" (base), "=c" (count), "=d" (off) : "D" (&bios32_entry) : "%esi", "cc", "memory"); diff --git a/sys/arch/i386/i386/db_magic.s b/sys/arch/i386/i386/db_magic.s index ee42475d166..5d43454f780 100644 --- a/sys/arch/i386/i386/db_magic.s +++ b/sys/arch/i386/i386/db_magic.s @@ -1,4 +1,4 @@ -/* $OpenBSD: db_magic.s,v 1.1 1996/05/04 14:33:00 mickey Exp $ */ +/* $OpenBSD: db_magic.s,v 1.2 2003/04/17 03:42:14 drahn Exp $ */ /* * Mach Operating System @@ -112,50 +112,50 @@ ENTRY(dr6) */ ENTRY(dr0) movl S_ARG0, %eax - movl %eax,_dr_addr + movl %eax,_C_LABEL(dr_addr) movl %eax, %db0 movl $0, %ecx jmp 0f ENTRY(dr1) movl S_ARG0, %eax - movl %eax,_dr_addr+1*4 + movl %eax,_C_LABEL(dr_addr)+1*4 movl %eax, %db1 movl $2, %ecx jmp 0f ENTRY(dr2) movl S_ARG0, %eax - movl %eax,_dr_addr+2*4 + movl %eax,_C_LABEL(dr_addr)+2*4 movl %eax, %db2 movl $4, %ecx jmp 0f ENTRY(dr3) movl S_ARG0, %eax - movl %eax,_dr_addr+3*4 + movl %eax,_C_LABEL(dr_addr)+3*4 movl %eax, %db3 movl $6, %ecx 0: pushl %ebp movl %esp, %ebp movl %db7, %edx - movl %edx,_dr_addr+4*4 + movl %edx,_C_LABEL(dr_addr)+4*4 andl dr_msk(,%ecx,2),%edx /* clear out new entry */ - movl %edx,_dr_addr+5*4 + movl %edx,_C_LABEL(dr_addr)+5*4 movzbl B_ARG3, %eax andb $3, %al shll %cl, %eax orl %eax, %edx movzbl B_ARG1, %eax andb $3, %al - addb $0x10, %ecx + add $0x10, %ecx shll %cl, %eax orl %eax, %edx movzbl B_ARG2, %eax andb $3, %al - addb $0x2, %ecx + add $0x2, %ecx shll %cl, %eax orl %eax, %edx movl %edx, %db7 - movl %edx,_dr_addr+7*4 + movl %edx,_C_LABEL(dr_addr)+7*4 movl %edx, %eax leave ret diff --git a/sys/arch/i386/i386/in_cksum.s b/sys/arch/i386/i386/in_cksum.s index 5347b9e16d1..9446b3e0726 100644 --- a/sys/arch/i386/i386/in_cksum.s +++ b/sys/arch/i386/i386/in_cksum.s @@ -1,4 +1,4 @@ -/* $OpenBSD: in_cksum.s,v 1.5 2001/07/04 08:57:47 niklas Exp $ */ +/* $OpenBSD: in_cksum.s,v 1.6 2003/04/17 03:42:14 drahn Exp $ */ /* * Copyright (c) 1996 Dave Richards <richards@zso.dec.com> @@ -180,13 +180,13 @@ in_cksum48: popl %edi # restore %edi in_cksum49: pushl %edi # len - bytes checksummed pushl $warning # push warning string - call _printf # printf() + call _C_LABEL(printf) # printf() leal 8(%esp), %esp # jmp in_cksum48 # .data - .align 2 + .align 4 table1: .long in_cksum8 # 4-byte aligned .long in_cksum4 # checksum 3 bytes diff --git a/sys/arch/i386/i386/linux_machdep.c b/sys/arch/i386/i386/linux_machdep.c index fd8dd6dc4c9..9aa4fa2302c 100644 --- a/sys/arch/i386/i386/linux_machdep.c +++ b/sys/arch/i386/i386/linux_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: linux_machdep.c,v 1.25 2003/03/28 00:49:13 miod Exp $ */ +/* $OpenBSD: linux_machdep.c,v 1.26 2003/04/17 03:42:14 drahn Exp $ */ /* $NetBSD: linux_machdep.c,v 1.29 1996/05/03 19:42:11 christos Exp $ */ /* @@ -149,8 +149,8 @@ linux_sendsig(catcher, sig, mask, code, type, val) } else #endif { - __asm("movl %%gs,%w0" : "=r" (frame.sf_sc.sc_gs)); - __asm("movl %%fs,%w0" : "=r" (frame.sf_sc.sc_fs)); + __asm("movl %%gs,%k0" : "=r" (frame.sf_sc.sc_gs)); + __asm("movl %%fs,%k0" : "=r" (frame.sf_sc.sc_fs)); frame.sf_sc.sc_es = tf->tf_es; frame.sf_sc.sc_ds = tf->tf_ds; frame.sf_sc.sc_eflags = tf->tf_eflags; diff --git a/sys/arch/i386/i386/locore.s b/sys/arch/i386/i386/locore.s index 40dc899926c..aedc30dc354 100644 --- a/sys/arch/i386/i386/locore.s +++ b/sys/arch/i386/i386/locore.s @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.s,v 1.68 2003/01/09 22:27:09 miod Exp $ */ +/* $OpenBSD: locore.s,v 1.69 2003/04/17 03:42:14 drahn Exp $ */ /* $NetBSD: locore.s,v 1.145 1996/05/03 19:41:19 christos Exp $ */ /*- @@ -70,9 +70,10 @@ /* * override user-land alignment before including asm.h */ -#define ALIGN_DATA .align 2 -#define ALIGN_TEXT .align 2,0x90 /* 4-byte boundaries, NOP-filled */ -#define SUPERALIGN_TEXT .align 4,0x90 /* 16-byte boundaries better for 486 */ + +#define ALIGN_DATA .align 4 +#define ALIGN_TEXT .align 4,0x90 /* 4-byte boundaries, NOP-filled */ +#define SUPERALIGN_TEXT .align 16,0x90 /* 16-byte boundaries better for 486 */ #define _ALIGN_TEXT ALIGN_TEXT #include <machine/asm.h> @@ -100,8 +101,8 @@ pushl %ds ; \ pushl %es ; \ movl $GSEL(GDATA_SEL, SEL_KPL),%eax ; \ - movl %ax,%ds ; \ - movl %ax,%es + movw %ax,%ds ; \ + movw %ax,%es #define INTRFASTEXIT \ popl %es ; \ popl %ds ; \ @@ -591,14 +592,14 @@ begin: /* Clear segment registers; always null in proc0. */ xorl %ecx,%ecx - movl %cx,%fs - movl %cx,%gs + movw %cx,%fs + movw %cx,%gs call _C_LABEL(main) NENTRY(proc_trampoline) pushl %ebx - call %esi + call *%esi addl $4,%esp INTRFASTEXIT /* NOTREACHED */ @@ -609,7 +610,7 @@ NENTRY(proc_trampoline) * Signal trampoline; copied to top of user stack. */ NENTRY(sigcode) - call SIGF_HANDLER(%esp) + call *SIGF_HANDLER(%esp) leal SIGF_SC(%esp),%eax # scp (the call may have clobbered the # copy at SIGF_SCP(%esp)) #ifdef VM86 @@ -618,8 +619,8 @@ NENTRY(sigcode) #endif movl SC_FS(%eax),%ecx movl SC_GS(%eax),%edx - movl %cx,%fs - movl %dx,%gs + movw %cx,%fs + movw %dx,%gs 1: pushl %eax pushl %eax # junk to fake return address movl $SYS_sigreturn,%eax @@ -633,7 +634,7 @@ _C_LABEL(esigcode): #ifdef COMPAT_SVR4 NENTRY(svr4_sigcode) - call SVR4_SIGF_HANDLER(%esp) + call *SVR4_SIGF_HANDLER(%esp) leal SVR4_SIGF_UC(%esp),%eax # ucp (the call may have clobbered the # copy at SIGF_UCP(%esp)) #ifdef VM86 @@ -642,8 +643,8 @@ NENTRY(svr4_sigcode) #endif movl SVR4_UC_FS(%eax),%ecx movl SVR4_UC_GS(%eax),%edx - movl %cx,%fs - movl %dx,%gs + movw %cx,%fs + movw %dx,%gs 1: pushl %eax pushl $1 # setcontext(p) == syscontext(1, p) pushl %eax # junk to fake return address @@ -662,7 +663,7 @@ _C_LABEL(svr4_esigcode): * Signal trampoline; copied to top of user stack. */ NENTRY(linux_sigcode) - call LINUX_SIGF_HANDLER(%esp) + call *LINUX_SIGF_HANDLER(%esp) leal LINUX_SIGF_SC(%esp),%ebx # scp (the call may have clobbered the # copy at SIGF_SCP(%esp)) #ifdef VM86 @@ -671,8 +672,8 @@ NENTRY(linux_sigcode) #endif movl LINUX_SC_FS(%ebx),%ecx movl LINUX_SC_GS(%ebx),%edx - movl %cx,%fs - movl %dx,%gs + movw %cx,%fs + movw %dx,%gs 1: pushl %eax # junk to fake return address movl $LINUX_SYS_sigreturn,%eax int $0x80 # enter kernel with args on stack @@ -689,7 +690,7 @@ _C_LABEL(linux_esigcode): * Signal trampoline; copied to top of user stack. */ NENTRY(freebsd_sigcode) - call FREEBSD_SIGF_HANDLER(%esp) + call *FREEBSD_SIGF_HANDLER(%esp) leal FREEBSD_SIGF_SC(%esp),%eax # scp (the call may have clobbered # the copy at SIGF_SCP(%esp)) pushl %eax @@ -1277,9 +1278,9 @@ NENTRY(lgdt) nop 1: /* Reload "stale" selectors. */ movl $GSEL(GDATA_SEL, SEL_KPL),%eax - movl %ax,%ds - movl %ax,%es - movl %ax,%ss + movw %ax,%ds + movw %ax,%es + movw %ax,%ss /* Reload code selector by doing intersegment return. */ popl %eax pushl $GSEL(GCODE_SEL, SEL_KPL) @@ -1527,8 +1528,8 @@ sw1: bsfl %ecx,%ebx # find a full q xorl %eax, %eax xorl %ecx, %ecx #endif - movl %fs,%ax - movl %gs,%cx + movw %fs,%ax + movw %gs,%cx movl %eax,PCB_FS(%esi) movl %ecx,PCB_GS(%esi) @@ -1587,8 +1588,8 @@ switch_exited: /* Restore segment registers. */ movl PCB_FS(%esi),%eax movl PCB_GS(%esi),%ecx - movl %ax,%fs - movl %cx,%gs + movw %ax,%fs + movw %cx,%gs switch_restored: /* Restore cr0 (including FPU state). */ @@ -1651,8 +1652,8 @@ ENTRY(switch_exit) /* Clear segment registers; always null in proc0. */ xorl %ecx,%ecx - movl %cx,%fs - movl %cx,%gs + movw %cx,%fs + movw %cx,%gs /* Restore cr0 (including FPU state). */ movl PCB_CR0(%esi),%ecx @@ -1688,8 +1689,8 @@ ENTRY(savectx) xorl %eax, %eax xorl %ecx, %ecx #endif - movl %fs,%ax - movl %gs,%cx + movw %fs,%ax + movw %gs,%cx movl %eax,PCB_FS(%edx) movl %ecx,PCB_GS(%edx) @@ -1714,7 +1715,7 @@ ENTRY(savectx) * XXX - debugger traps are now interrupt gates so at least bdb doesn't lose * control. The sti's give the standard losing behaviour for ddb and kgdb. */ -#define IDTVEC(name) ALIGN_TEXT; .globl _X/**/name; _X/**/name: +#define IDTVEC(name) ALIGN_TEXT; .globl X/**/name; X/**/name: #define TRAP(a) pushl $(a) ; jmp _C_LABEL(alltraps) #define ZTRAP(a) pushl $0 ; TRAP(a) @@ -1820,7 +1821,7 @@ NENTRY(resume_iret) ZTRAP(T_PROTFLT) NENTRY(resume_pop_ds) movl $GSEL(GDATA_SEL, SEL_KPL),%eax - movl %ax,%es + movw %ax,%es NENTRY(resume_pop_es) movl $T_PROTFLT,TF_TRAPNO(%esp) jmp calltrap diff --git a/sys/arch/i386/i386/microtime.s b/sys/arch/i386/i386/microtime.s index 8ec301e0dc6..718f20842b7 100644 --- a/sys/arch/i386/i386/microtime.s +++ b/sys/arch/i386/i386/microtime.s @@ -1,4 +1,4 @@ -/* $OpenBSD: microtime.s,v 1.16 2002/09/24 00:06:22 nordin Exp $ */ +/* $OpenBSD: microtime.s,v 1.17 2003/04/17 03:42:14 drahn Exp $ */ /* $NetBSD: microtime.s,v 1.16 1995/04/17 12:06:47 cgd Exp $ */ /*- @@ -49,7 +49,7 @@ ENTRY(microtime) #if defined(I586_CPU) || defined(I686_CPU) - movl _pentium_mhz, %ecx + movl _C_LABEL(pentium_mhz), %ecx testl %ecx, %ecx jne pentium_microtime #else @@ -97,7 +97,7 @@ ENTRY(microtime) movl $11932,%edx # counter limit - testb $IRQ_BIT(0),_ipending + IRQ_BYTE(0) + testb $IRQ_BIT(0),_C_LABEL(ipending) + IRQ_BYTE(0) jnz 1f cmpl $12,%ecx # check for potential overflow @@ -123,8 +123,8 @@ ENTRY(microtime) shrl $12,%eax # a = a/4096 = 3433d/4096 common_microtime: - movl _time,%edx # get time.tv_sec - addl _time+4,%eax # add time.tv_usec + movl _C_LABEL(time),%edx # get time.tv_sec + addl _C_LABEL(time)+4,%eax # add time.tv_usec popfl # enable interrupts @@ -141,8 +141,8 @@ common_microtime: #if defined(I586_CPU) || defined(I686_CPU) .data - .globl _pentium_base_tsc - .comm _pentium_base_tsc,8 + .globl _C_LABEL(pentium_base_tsc) + .comm _C_LABEL(pentium_base_tsc),8 .text .align 2, 0x90 @@ -150,8 +150,8 @@ pentium_microtime: pushfl cli .byte 0x0f, 0x31 # RDTSC - subl _pentium_base_tsc,%eax - sbbl _pentium_base_tsc+4,%edx + subl _C_LABEL(pentium_base_tsc),%eax + sbbl _C_LABEL(pentium_base_tsc)+4,%edx /* * correct the high word first so we won't * receive a result overflow aka div/0 fault diff --git a/sys/arch/i386/i386/random.s b/sys/arch/i386/i386/random.s index c0202ed0577..c40bad195b8 100644 --- a/sys/arch/i386/i386/random.s +++ b/sys/arch/i386/i386/random.s @@ -1,4 +1,4 @@ -/* $OpenBSD: random.s,v 1.3 2001/07/04 08:57:47 niklas Exp $ */ +/* $OpenBSD: random.s,v 1.4 2003/04/17 03:42:14 drahn Exp $ */ /* $NetBSD: random.s,v 1.5 1995/01/15 23:20:33 mycroft Exp $ */ /* @@ -45,20 +45,20 @@ #include <machine/asm.h> .data - .globl __randseed -__randseed: + .globl _C_LABEL(_randseed) +_C_LABEL(_randseed): .long 1 .text ENTRY(random) movl $16807,%eax - imull __randseed + imull _C_LABEL(_randseed) shld $1,%eax,%edx andl $0x7fffffff,%eax addl %edx,%eax js 1f - movl %eax,__randseed + movl %eax,_C_LABEL(_randseed) ret 1: subl $0x7fffffff,%eax - movl %eax,__randseed + movl %eax,_C_LABEL(_randseed) ret diff --git a/sys/arch/i386/i386/svr4_machdep.c b/sys/arch/i386/i386/svr4_machdep.c index cd36a59e9e7..c3f63b18b87 100644 --- a/sys/arch/i386/i386/svr4_machdep.c +++ b/sys/arch/i386/i386/svr4_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: svr4_machdep.c,v 1.17 2003/03/28 00:49:13 miod Exp $ */ +/* $OpenBSD: svr4_machdep.c,v 1.18 2003/04/17 03:42:14 drahn Exp $ */ /* $NetBSD: svr4_machdep.c,v 1.24 1996/05/03 19:42:26 christos Exp $ */ /* @@ -85,8 +85,8 @@ svr4_getcontext(p, uc, mask, oonstack) } else #endif { - __asm("movl %%gs,%w0" : "=r" (r[SVR4_X86_GS])); - __asm("movl %%fs,%w0" : "=r" (r[SVR4_X86_FS])); + __asm("movl %%gs,%k0" : "=r" (r[SVR4_X86_GS])); + __asm("movl %%fs,%k0" : "=r" (r[SVR4_X86_FS])); r[SVR4_X86_ES] = tf->tf_es; r[SVR4_X86_DS] = tf->tf_ds; r[SVR4_X86_EFL] = tf->tf_eflags; diff --git a/sys/arch/i386/include/asm.h b/sys/arch/i386/include/asm.h index c2f3fa9d271..46832bff302 100644 --- a/sys/arch/i386/include/asm.h +++ b/sys/arch/i386/include/asm.h @@ -1,4 +1,4 @@ -/* $OpenBSD: asm.h,v 1.5 2001/09/05 08:22:36 espie Exp $ */ +/* $OpenBSD: asm.h,v 1.6 2003/04/17 03:42:14 drahn Exp $ */ /* $NetBSD: asm.h,v 1.7 1994/10/27 04:15:56 cgd Exp $ */ /*- @@ -45,10 +45,10 @@ #ifdef PIC #define PIC_PROLOGUE \ pushl %ebx; \ - call 1f; \ -1: \ + call 666f; \ +666: \ popl %ebx; \ - addl $__GLOBAL_OFFSET_TABLE_+[.-1b], %ebx + addl $_C_LABEL(_GLOBAL_OFFSET_TABLE_)+[.-666b], %ebx #define PIC_EPILOGUE \ popl %ebx #define PIC_PLT(x) x@PLT @@ -62,13 +62,22 @@ #define PIC_GOTOFF(x) x #endif -#ifdef __STDC__ -# define _C_LABEL(x) _ ## x -#else -# define _C_LABEL(x) _/**/x -#endif +#define _C_LABEL(name) name #define _ASM_LABEL(x) x +/* + * WEAK ALIAS: create a weak alias + */ +#define WEAK_ALIAS(alias,sym) \ + .weak alias; \ + alias = sym + +/* + * WARN_REFERENCES: create a warning if the specified symbol is referenced + */ +#define WARN_REFERENCES(_sym,_msg) \ + .section .gnu.warning. ## _sym ; .ascii _msg ; .text + /* let kernels and others override entrypoint alignment */ #ifndef _ALIGN_TEXT # define _ALIGN_TEXT .align 2, 0x90 diff --git a/sys/arch/i386/include/bus.h b/sys/arch/i386/include/bus.h index 17eb623e549..f88ed6afd10 100644 --- a/sys/arch/i386/include/bus.h +++ b/sys/arch/i386/include/bus.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bus.h,v 1.34 2003/01/16 04:16:00 art Exp $ */ +/* $OpenBSD: bus.h,v 1.35 2003/04/17 03:42:14 drahn Exp $ */ /* $NetBSD: bus.h,v 1.6 1996/11/10 03:19:25 thorpej Exp $ */ /*- @@ -639,9 +639,9 @@ void bus_space_free(bus_space_tag_t t, bus_space_handle_t bsh, int _port1 = (h1)+(o1); int _port2 = (h2)+(o2); int _cnt=(cnt); \ if ((t) == I386_BUS_SPACE_IO) { \ __asm __volatile(" \ - 1: movl %w1,%%dx ; \ + 1: movl %k1,%%edx ; \ inb %%dx,%%al ; \ - movl %w0,%%dx ; \ + movl %k0,%%edx ; \ outb %%al,%%dx ; \ incl %0 ; \ incl %1 ; \ @@ -656,14 +656,14 @@ void bus_space_free(bus_space_tag_t t, bus_space_handle_t bsh, int _port1 = (h1)+(o1); int _port2 = (h2)+(o2); int _cnt=(cnt); \ if ((t) == I386_BUS_SPACE_IO) { \ __asm __volatile(" \ - 1: movl %w1,%%dx ; \ + 1: movl %k1,%%edx ; \ inw %%dx,%%ax ; \ - movl %w0,%%dx ; \ + movl %k0,%%edx ; \ outw %%ax,%%dx ; \ addl $2, %0 ; \ addl $2, %1 ; \ loop 1b" : \ - "+D" (_port2), "+S" (_port1), "+c" ((_cnt)) :: \ + "+D" (_port2), "+ES" (_port1), "+c" ((_cnt)) :: \ "%edx", "%eax", "cc"); \ } else \ i386_space_copy(_port1, _port2, 2, _cnt); \ @@ -673,14 +673,14 @@ void bus_space_free(bus_space_tag_t t, bus_space_handle_t bsh, int _port1 = (h1)+(o1); int _port2 = (h2)+(o2); int _cnt=(cnt); \ if ((t) == I386_BUS_SPACE_IO) { \ __asm __volatile(" \ - 1: movl %w1,%%dx ; \ + 1: movl %k1,%%edx ; \ inl %%dx,%%eax ; \ - movl %w0,%%dx ; \ + movl %k0,%%edx ; \ outl %%eax,%%dx ; \ addl $4, %0 ; \ addl $4, %1 ; \ loop 1b" : \ - "+D" (_port2), "+S" (_port1), "+c" ((_cnt)) :: \ + "+D" (_port2), "+ES" (_port1), "+c" ((_cnt)) :: \ "%edx", "%eax", "cc"); \ } else \ i386_space_copy(_port1, _port2, 4, _cnt); \ diff --git a/sys/arch/i386/include/cdefs.h b/sys/arch/i386/include/cdefs.h index 8fd34381d4c..b2a8cb5b919 100644 --- a/sys/arch/i386/include/cdefs.h +++ b/sys/arch/i386/include/cdefs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cdefs.h,v 1.7 2001/08/18 02:35:06 brad Exp $ */ +/* $OpenBSD: cdefs.h,v 1.8 2003/04/17 03:42:14 drahn Exp $ */ /* $NetBSD: cdefs.h,v 1.2 1995/03/23 20:10:26 jtc Exp $ */ /* @@ -9,34 +9,11 @@ #ifndef _MACHINE_CDEFS_H_ #define _MACHINE_CDEFS_H_ -#ifndef _C_LABEL -#ifdef __STDC__ -#define _C_LABEL(x) __STRING(_ ## x) -#else -#define _C_LABEL(x) __STRING(_/**/x) -#endif -#endif /* _C_LABEL */ - -#ifdef __GNUC__ -#ifdef __STDC__ -#define __indr_reference(sym,alias) \ - __asm__(".stabs \"_" #alias "\",11,0,0,0"); \ - __asm__(".stabs \"_" #sym "\",1,0,0,0") -#define __warn_references(sym,msg) \ - __asm__(".stabs \"" msg "\",30,0,0,0"); \ - __asm__(".stabs \"_" #sym "\",1,0,0,0") -#define __weak_alias(alias,sym) \ - __asm__(".weak _" #alias "; _" #alias "= _" __STRING(sym)) -#else -#define __indr_reference(sym,alias) \ - __asm__(".stabs \"_/**/alias\",11,0,0,0"); \ - __asm__(".stabs \"_/**/sym\",1,0,0,0") -#define __warn_references(sym,msg) \ - __asm__(".stabs msg,30,0,0,0"); \ - __asm__(".stabs \"_/**/sym\",1,0,0,0") -#define __weak_alias(alias,sym) \ - __asm__(".weak _/**/alias; _/**/alias = _/**/sym") -#endif +#if defined(__GNUC__) && defined(__STDC__) +#define __weak_alias(alias,sym) \ + __asm__(".weak " __STRING(alias) " ; " __STRING(alias) " = " __STRING(sym)) +#define __warn_references(sym,msg) \ + __asm__(".section .gnu.warning." __STRING(sym) " ; .ascii \"" msg "\" ; .text") #else #define __indr_reference(sym,alias) #define __warn_references(sym,msg) diff --git a/sys/arch/i386/include/db_machdep.h b/sys/arch/i386/include/db_machdep.h index a95248af211..724ec0630fb 100644 --- a/sys/arch/i386/include/db_machdep.h +++ b/sys/arch/i386/include/db_machdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: db_machdep.h,v 1.7 2002/03/14 01:26:33 millert Exp $ */ +/* $OpenBSD: db_machdep.h,v 1.8 2003/04/17 03:42:14 drahn Exp $ */ /* $NetBSD: db_machdep.h,v 1.9 1996/05/03 19:23:59 christos Exp $ */ /* @@ -97,6 +97,8 @@ boolean_t db_phys_eq(task_t, vaddr_t, task_t, vaddr_t); #define DB_TASK_NAME_TITLE "COMMAND " #define DB_TASK_NAME_LEN 23 #define DB_NULL_TASK_NAME "? " +#define DB_ELF_SYMBOLS +#define DB_ELFSIZE 32 /* * Constants for KGDB. diff --git a/sys/arch/i386/include/exec.h b/sys/arch/i386/include/exec.h index d2da6e9965e..d091741917b 100644 --- a/sys/arch/i386/include/exec.h +++ b/sys/arch/i386/include/exec.h @@ -1,4 +1,4 @@ -/* $OpenBSD: exec.h,v 1.8 2001/01/22 14:51:04 art Exp $ */ +/* $OpenBSD: exec.h,v 1.9 2003/04/17 03:42:14 drahn Exp $ */ /* $NetBSD: exec.h,v 1.6 1994/10/27 04:16:05 cgd Exp $ */ /* @@ -33,19 +33,7 @@ #define __LDPGSZ 4096 -/* Relocation format. */ -struct relocation_info_i386 { - int r_address; /* offset in text or data segment */ - unsigned int r_symbolnum : 24, /* ordinal number of add symbol */ - r_pcrel : 1, /* 1 if value should be pc-relative */ - r_length : 2, /* log base 2 of value's width */ - r_extern : 1, /* 1 if need to add symbol to value */ - r_baserel : 1, /* linkage table relative */ - r_jmptable : 1, /* relocate to jump table */ - r_relative : 1, /* load address relative */ - r_copy : 1; /* run time copy */ -}; -#define relocation_info relocation_info_i386 +#define NATIVE_EXEC_ELF #define ARCH_ELFSIZE 32 @@ -58,9 +46,6 @@ struct relocation_info_i386 { #define _NLIST_DO_ELF #define _KERN_DO_AOUT -#if defined(COMPAT_LINUX) || defined(COMPAT_SVR4) || defined(COMPAT_FREEBSD) || \ - !defined(_KERNEL) #define _KERN_DO_ELF -#endif #endif /* _I386_EXEC_H_ */ diff --git a/sys/arch/i386/include/intr.h b/sys/arch/i386/include/intr.h index 3341083146b..d149d5bcab0 100644 --- a/sys/arch/i386/include/intr.h +++ b/sys/arch/i386/include/intr.h @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.h,v 1.18 2002/12/11 07:16:11 art Exp $ */ +/* $OpenBSD: intr.h,v 1.19 2003/04/17 03:42:14 drahn Exp $ */ /* $NetBSD: intr.h,v 1.5 1996/05/13 06:11:28 mycroft Exp $ */ /* @@ -226,7 +226,8 @@ static __inline void softintr(mask) int mask; { - __asm __volatile("orl %0,_ipending" : : "ir" (mask)); + __asm __volatile("orl %1, %0" : "=m"(ipending) : "ir" (mask)); + } #define setsoftast() (astpending = 1) diff --git a/sys/arch/i386/include/loadfile_machdep.h b/sys/arch/i386/include/loadfile_machdep.h new file mode 100644 index 00000000000..a121e81d4ef --- /dev/null +++ b/sys/arch/i386/include/loadfile_machdep.h @@ -0,0 +1,59 @@ +/* $OpenBSD: loadfile_machdep.h,v 1.1 2003/04/17 03:42:14 drahn Exp $ */ +/* $NetBSD: loadfile_machdep.h,v 1.1 1999/04/29 03:17:12 tsubai Exp $ */ + +/*- + * Copyright (c) 1999 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#define BOOT_ELF +#define ELFSIZE 32 + +#define LOAD_KERNEL (LOAD_ALL & ~LOAD_TEXTA) +#define COUNT_KERNEL (COUNT_ALL & ~COUNT_TEXTA) + +#define LOADADDR(a) ((((u_long)(a)) + offset)&0xfffffff) +#define ALIGNENTRY(a) ((u_long)(a)) +#define READ(f, b, c) read((f), (void *)LOADADDR(b), (c)) +#define BCOPY(s, d, c) memcpy((void *)LOADADDR(d), (void *)(s), (c)) +#define BZERO(d, c) memset((void *)LOADADDR(d), 0, (c)) +#define WARN(a) (void)(printf a, \ + printf((errno ? ": %s\n" : "\n"), \ + strerror(errno))) +#define PROGRESS(a) (void) printf a +#define ALLOC(a) alloc(a) +#define FREE(a, b) free(a, b) +#define OKMAGIC(a) ((a) == OMAGIC) + +void run_loadfile(u_long *, int); diff --git a/sys/arch/i386/include/param.h b/sys/arch/i386/include/param.h index bce3df6538e..9fd2eede37e 100644 --- a/sys/arch/i386/include/param.h +++ b/sys/arch/i386/include/param.h @@ -1,4 +1,4 @@ -/* $OpenBSD: param.h,v 1.22 2003/04/09 07:53:57 niklas Exp $ */ +/* $OpenBSD: param.h,v 1.23 2003/04/17 03:42:14 drahn Exp $ */ /* $NetBSD: param.h,v 1.29 1996/03/04 05:04:26 cgd Exp $ */ /*- @@ -61,9 +61,15 @@ * Round p (pointer or byte index) up to a correctly-aligned value * for all data types (int, long, ...). The result is u_int and * must be cast to any desired pointer type. + * + * ALIGNED_POINTER is a boolean macro that checks whether an address + * is valid to fetch data elements of type t from on this architecture. + * This does not reflect the optimal alignment, just the possibility + * (within reasonable limits). */ #define ALIGNBYTES (sizeof(int) - 1) #define ALIGN(p) (((u_int)(p) + ALIGNBYTES) &~ ALIGNBYTES) +#define ALIGNED_POINTER(p,t) 1 #define PGSHIFT 12 /* LOG2(NBPG) */ #define NBPG (1 << PGSHIFT) /* bytes/page */ diff --git a/sys/arch/i386/include/reloc.h b/sys/arch/i386/include/reloc.h new file mode 100644 index 00000000000..8f597ff7c0c --- /dev/null +++ b/sys/arch/i386/include/reloc.h @@ -0,0 +1,50 @@ +/* $OpenBSD: reloc.h,v 1.1 2003/04/17 03:42:14 drahn Exp $ */ + +/* + * Copyright (c) 2002,2003 Dale Rahn + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _MACH_RELOC_H +#define _MACH_RELOC_H +#define R_TYPE(X) __CONCAT(RELOC_,X) + + +#define RELOC_NONE 0 /* No reloc */ +#define RELOC_32 1 /* Direct 32 bit */ +#define RELOC_PC32 2 /* PC relative 32 bit */ +#define RELOC_GOT32 3 /* 32 bit GOT entry */ +#define RELOC_PLT32 4 /* 32 bit PLT address */ +#define RELOC_COPY 5 /* Copy symbol at runtime */ +#define RELOC_GLOB_DAT 6 /* Create GOT entry */ +#define RELOC_JUMP_SLOT 7 /* Create PLT entry */ +#define RELOC_RELATIVE 8 /* Adjust by program base */ +#define RELOC_GOTOFF 9 /* 32 bit offset to GOT */ +#define RELOC_GOTPC 10 /* 32 bit PC relative offset to GOT */ +#define RELOC_16 20 +#define RELOC_PC16 21 +#define RELOC_8 22 +#define RELOC_PC8 23 + +#endif /* _MACH_RELOC_H */ + + diff --git a/sys/arch/i386/include/vmparam.h b/sys/arch/i386/include/vmparam.h index 68ac4d12f71..51065871af3 100644 --- a/sys/arch/i386/include/vmparam.h +++ b/sys/arch/i386/include/vmparam.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmparam.h,v 1.25 2003/01/16 04:16:00 art Exp $ */ +/* $OpenBSD: vmparam.h,v 1.26 2003/04/17 03:42:14 drahn Exp $ */ /* $NetBSD: vmparam.h,v 1.15 1994/10/27 04:16:34 cgd Exp $ */ /*- @@ -67,7 +67,7 @@ #define DFLDSIZ (64*1024*1024) /* initial data size limit */ #endif #ifndef MAXDSIZ -#define MAXDSIZ (1*1024*1024*1024) /* max data size */ +#define MAXDSIZ (512*1024*1024) /* max data size */ #endif #ifndef DFLSSIZ #define DFLSSIZ (4*1024*1024) /* initial stack size limit */ diff --git a/sys/arch/i386/isa/icu.s b/sys/arch/i386/isa/icu.s index 57b11456f29..3aff719725a 100644 --- a/sys/arch/i386/isa/icu.s +++ b/sys/arch/i386/isa/icu.s @@ -1,4 +1,4 @@ -/* $OpenBSD: icu.s,v 1.18 2001/12/04 00:00:36 niklas Exp $ */ +/* $OpenBSD: icu.s,v 1.19 2003/04/17 03:42:14 drahn Exp $ */ /* $NetBSD: icu.s,v 1.45 1996/01/07 03:59:34 mycroft Exp $ */ /*- @@ -139,7 +139,7 @@ IDTVEC(softtty) call _C_LABEL(comsoft) movl %ebx,_C_LABEL(cpl) #endif - jmp %esi + jmp *%esi #define DONETISR(s, c) \ .globl _C_LABEL(c) ;\ @@ -155,7 +155,7 @@ IDTVEC(softnet) xchgl _C_LABEL(netisr),%edi #include <net/netisr_dispatch.h> movl %ebx,_C_LABEL(cpl) - jmp %esi + jmp *%esi #undef DONETISR IDTVEC(softclock) @@ -163,5 +163,5 @@ IDTVEC(softclock) movl %eax,_C_LABEL(cpl) call _C_LABEL(softclock) movl %ebx,_C_LABEL(cpl) - jmp %esi + jmp *%esi diff --git a/sys/arch/i386/isa/npx.c b/sys/arch/i386/isa/npx.c index a976ea241b1..6b66cb3bc31 100644 --- a/sys/arch/i386/isa/npx.c +++ b/sys/arch/i386/isa/npx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: npx.c,v 1.25 2002/03/14 01:26:33 millert Exp $ */ +/* $OpenBSD: npx.c,v 1.26 2003/04/17 03:42:14 drahn Exp $ */ /* $NetBSD: npx.c,v 1.57 1996/05/12 23:12:24 mycroft Exp $ */ #if 0 @@ -152,9 +152,9 @@ extern int i386_fpu_fdivbug; */ void probeintr(void); asm (".text\n\t" -"_probeintr:\n\t" +"probeintr:\n\t" "ss\n\t" - "incl _npx_intrs_while_probing\n\t" + "incl npx_intrs_while_probing\n\t" "pushl %eax\n\t" "movb $0x20,%al # EOI (asm in strings loses cpp features)\n\t" "outb %al,$0xa0 # IO_ICU2\n\t" @@ -166,9 +166,9 @@ asm (".text\n\t" void probetrap(void); asm (".text\n\t" -"_probetrap:\n\t" +"probetrap:\n\t" "ss\n\t" - "incl _npx_traps_while_probing\n\t" + "incl npx_traps_while_probing\n\t" "fnclex\n\t" "iret\n\t"); @@ -307,7 +307,7 @@ npxprobe(parent, match, aux) int npx586bug1(int, int); asm (".text\n\t" -"_npx586bug1:\n\t" +"npx586bug1:\n\t" "fildl 4(%esp) # x\n\t" "fildl 8(%esp) # y\n\t" "fld %st(1)\n\t" diff --git a/sys/arch/i386/isa/vector.s b/sys/arch/i386/isa/vector.s index 1407c3166fe..93a7bab51da 100644 --- a/sys/arch/i386/isa/vector.s +++ b/sys/arch/i386/isa/vector.s @@ -1,4 +1,4 @@ -/* $OpenBSD: vector.s,v 1.15 2001/12/06 21:09:13 niklas Exp $ */ +/* $OpenBSD: vector.s,v 1.16 2003/04/17 03:42:14 drahn Exp $ */ /* $NetBSD: vector.s,v 1.32 1996/01/07 21:29:47 mycroft Exp $ */ /* @@ -85,16 +85,16 @@ #ifdef ICU_HARDWARE_MASK #define MASK(irq_num, icu) \ - movb _imen + IRQ_BYTE(irq_num),%al ;\ + movb _C_LABEL(imen) + IRQ_BYTE(irq_num),%al ;\ orb $IRQ_BIT(irq_num),%al ;\ - movb %al,_imen + IRQ_BYTE(irq_num) ;\ + movb %al,_C_LABEL(imen) + IRQ_BYTE(irq_num) ;\ FASTER_NOP ;\ outb %al,$(icu+1) #define UNMASK(irq_num, icu) \ cli ;\ - movb _imen + IRQ_BYTE(irq_num),%al ;\ + movb _C_LABEL(imen) + IRQ_BYTE(irq_num),%al ;\ andb $~IRQ_BIT(irq_num),%al ;\ - movb %al,_imen + IRQ_BYTE(irq_num) ;\ + movb %al,_C_LABEL(imen) + IRQ_BYTE(irq_num) ;\ FASTER_NOP ;\ outb %al,$(icu+1) ;\ sti @@ -130,7 +130,7 @@ * scattered cld's? */ - .globl _isa_strayintr + .globl _C_LABEL(isa_strayintr) /* * Normal vectors. @@ -154,7 +154,7 @@ IDTVEC(recurse/**/irq_num) ;\ pushl %cs ;\ pushl %esi ;\ cli ;\ -_Xintr/**/irq_num/**/: ;\ +_C_LABEL(Xintr)/**/irq_num/**/: ;\ pushl $0 /* dummy error code */ ;\ pushl $T_ASTFLT /* trap # for doing ASTs */ ;\ INTRENTRY ;\ @@ -162,26 +162,26 @@ _Xintr/**/irq_num/**/: ;\ MASK(irq_num, icu) /* mask it in hardware */ ;\ ack(irq_num) /* and allow other intrs */ ;\ incl MY_COUNT+V_INTR /* statistical info */ ;\ - movl _C_LABEL(iminlevel) + (irq_num) * 4, %eax ;\ + movl _C_LABEL(iminlevel) + (irq_num) * 4, %eax ;\ movzbl _C_LABEL(cpl),%ebx ;\ cmpl %eax,%ebx ;\ jae _C_LABEL(Xhold/**/irq_num)/* currently masked; hold it */;\ -_Xresume/**/irq_num/**/: ;\ +_C_LABEL(Xresume)/**/irq_num/**/: ;\ movzbl _C_LABEL(cpl),%eax /* cpl to restore on exit */ ;\ pushl %eax ;\ - movl _C_LABEL(imaxlevel) + (irq_num) * 4,%eax ;\ + movl _C_LABEL(imaxlevel) + (irq_num) * 4,%eax ;\ movl %eax,_C_LABEL(cpl) /* block enough for this irq */ ;\ sti /* safe to take intrs now */ ;\ - movl _intrhand + (irq_num) * 4,%ebx /* head of chain */ ;\ + movl _C_LABEL(intrhand) + (irq_num) * 4,%ebx /* head of chain */ ;\ testl %ebx,%ebx ;\ - jz _Xstray/**/irq_num /* no handlears; we're stray */ ;\ + jz _C_LABEL(Xstray)/**/irq_num /* no handlears; we're stray */ ;\ STRAY_INITIALIZE /* nobody claimed it yet */ ;\ 7: movl IH_ARG(%ebx),%eax /* get handler arg */ ;\ testl %eax,%eax ;\ jnz 4f ;\ movl %esp,%eax /* 0 means frame pointer */ ;\ 4: pushl %eax ;\ - call IH_FUN(%ebx) /* call it */ ;\ + call *IH_FUN(%ebx) /* call it */ ;\ addl $4,%esp /* toss the arg */ ;\ STRAY_INTEGRATE /* maybe he claimed it */ ;\ orl %eax,%eax /* should it be counted? */ ;\ @@ -192,14 +192,14 @@ _Xresume/**/irq_num/**/: ;\ jnz 7b ;\ STRAY_TEST /* see if it's a stray */ ;\ 6: UNMASK(irq_num, icu) /* unmask it in hardware */ ;\ - jmp _Xdoreti /* lower spl and do ASTs */ ;\ + jmp _C_LABEL(Xdoreti) /* lower spl and do ASTs */ ;\ IDTVEC(stray/**/irq_num) ;\ pushl $irq_num ;\ - call _isa_strayintr ;\ + call _C_LABEL(isa_strayintr) ;\ addl $4,%esp ;\ jmp 6b ;\ IDTVEC(hold/**/irq_num) ;\ - orb $IRQ_BIT(irq_num),_ipending + IRQ_BYTE(irq_num) ;\ + orb $IRQ_BIT(irq_num),_C_LABEL(ipending) + IRQ_BYTE(irq_num) ;\ INTRFASTEXIT #if defined(DEBUG) && defined(notdef) @@ -209,7 +209,7 @@ IDTVEC(hold/**/irq_num) ;\ orl %eax,%esi #define STRAY_TEST \ testl %esi,%esi ;\ - jz _Xstray/**/irq_num + jz _C_LABEL(Xstray)/**/irq_num #else /* !DEBUG */ #define STRAY_INITIALIZE #define STRAY_INTEGRATE @@ -245,37 +245,51 @@ INTR(15, IO_ICU2, ACK2) */ /* interrupt service routine entry points */ IDTVEC(intr) - .long _Xintr0, _Xintr1, _Xintr2, _Xintr3, _Xintr4, _Xintr5, _Xintr6 - .long _Xintr7, _Xintr8, _Xintr9, _Xintr10, _Xintr11, _Xintr12 - .long _Xintr13, _Xintr14, _Xintr15 + .long _C_LABEL(Xintr0), _C_LABEL(Xintr1), _C_LABEL(Xintr2) + .long _C_LABEL(Xintr3), _C_LABEL(Xintr4), _C_LABEL(Xintr5) + .long _C_LABEL(Xintr6), _C_LABEL(Xintr7), _C_LABEL(Xintr8) + .long _C_LABEL(Xintr9), _C_LABEL(Xintr10), _C_LABEL(Xintr11) + .long _C_LABEL(Xintr12), _C_LABEL(Xintr13) + .long _C_LABEL(Xintr14), _C_LABEL(Xintr15) /* * These tables are used by Xdoreti() and Xspllower(). */ /* resume points for suspended interrupts */ IDTVEC(resume) - .long _Xresume0, _Xresume1, _Xresume2, _Xresume3, _Xresume4 - .long _Xresume5, _Xresume6, _Xresume7, _Xresume8, _Xresume9 - .long _Xresume10, _Xresume11, _Xresume12, _Xresume13, _Xresume14 - .long _Xresume15 + .long _C_LABEL(Xresume0), _C_LABEL(Xresume1) + .long _C_LABEL(Xresume2), _C_LABEL(Xresume3) + .long _C_LABEL(Xresume4), _C_LABEL(Xresume5) + .long _C_LABEL(Xresume6), _C_LABEL(Xresume7) + .long _C_LABEL(Xresume8), _C_LABEL(Xresume9) + .long _C_LABEL(Xresume10), _C_LABEL(Xresume11) + .long _C_LABEL(Xresume12), _C_LABEL(Xresume13) + .long _C_LABEL(Xresume14), _C_LABEL(Xresume15) /* for soft interrupts */ .long 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - .long _Xsofttty, _Xsoftnet, _Xsoftclock + .long _C_LABEL(Xsofttty), _C_LABEL(Xsoftnet) + .long _C_LABEL(Xsoftclock) /* fake interrupts to resume from splx() */ IDTVEC(recurse) - .long _Xrecurse0, _Xrecurse1, _Xrecurse2, _Xrecurse3, _Xrecurse4 - .long _Xrecurse5, _Xrecurse6, _Xrecurse7, _Xrecurse8, _Xrecurse9 - .long _Xrecurse10, _Xrecurse11, _Xrecurse12, _Xrecurse13, _Xrecurse14 - .long _Xrecurse15 + .long _C_LABEL(Xrecurse0), _C_LABEL(Xrecurse1) + .long _C_LABEL(Xrecurse2), _C_LABEL(Xrecurse3) + .long _C_LABEL(Xrecurse4), _C_LABEL(Xrecurse5) + .long _C_LABEL(Xrecurse6), _C_LABEL(Xrecurse7) + .long _C_LABEL(Xrecurse8), _C_LABEL(Xrecurse9) + .long _C_LABEL(Xrecurse10), _C_LABEL(Xrecurse11) + .long _C_LABEL(Xrecurse12), _C_LABEL(Xrecurse13) + .long _C_LABEL(Xrecurse14), _C_LABEL(Xrecurse15) /* for soft interrupts */ .long 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - .long _Xsofttty, _Xsoftnet, _Xsoftclock + .long _C_LABEL(Xsofttty), _C_LABEL(Xsoftnet) + .long _C_LABEL(Xsoftclock) /* Some bogus data, to keep vmstat happy, for now. */ - .globl _intrnames, _eintrnames, _intrcnt, _eintrcnt -_intrnames: + .globl _C_LABEL(intrnames), _C_LABEL(eintrnames) + .globl _C_LABEL(intrcnt), _C_LABEL(eintrcnt) +_C_LABEL(intrnames): .long 0 -_eintrnames: -_intrcnt: +_C_LABEL(eintrnames): +_C_LABEL(intrcnt): .long 0 -_eintrcnt: +_C_LABEL(eintrcnt): diff --git a/sys/arch/i386/pci/pcibios.c b/sys/arch/i386/pci/pcibios.c index b4bd569e005..322b5d46d3e 100644 --- a/sys/arch/i386/pci/pcibios.c +++ b/sys/arch/i386/pci/pcibios.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcibios.c,v 1.27 2002/07/12 21:17:06 mickey Exp $ */ +/* $OpenBSD: pcibios.c,v 1.28 2003/04/17 03:42:14 drahn Exp $ */ /* $NetBSD: pcibios.c,v 1.5 2000/08/01 05:23:59 uch Exp $ */ /* @@ -358,9 +358,9 @@ pcibios_get_status(sc, rev_maj, rev_min, mech1, mech2, scmech1, scmech2, maxbus) __asm __volatile("pushl %%es\n\t" "pushl %%ds\n\t" - "movw 4(%%edi), %%ecx\n\t" + "movw 4(%%edi), %%cx\n\t" "movl %%ecx, %%ds\n\t" - "lcall %%cs:(%%edi)\n\t" + "lcall %%cs:*(%%edi)\n\t" "pop %%ds\n\t" "pop %%es\n\t" "jc 1f\n\t" @@ -414,9 +414,9 @@ pcibios_get_intr_routing(sc, table, nentries, exclirq) __asm __volatile("pushl %%es\n\t" "pushl %%ds\n\t" - "movw 4(%%esi), %%ecx\n\t" + "movw 4(%%esi), %%cx\n\t" "movl %%ecx, %%ds\n\t" - "lcall %%cs:(%%esi)\n\t" + "lcall %%cs:*(%%esi)\n\t" "popl %%ds\n\t" "popl %%es\n\t" "jc 1f\n\t" |