Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/sommerfeld_i386mp_1]: src/sys/arch/i386 squish some more assembler warni...
details: https://anonhg.NetBSD.org/src/rev/c54b931999c0
branches: sommerfeld_i386mp_1
changeset: 482503:c54b931999c0
user: sommerfeld <sommerfeld%NetBSD.org@localhost>
date: Sun Feb 24 01:55:11 2002 +0000
description:
squish some more assembler warnings.
diffstat:
sys/arch/i386/i386/bios32.c | 178 +++++++++++
sys/arch/i386/i386/ibcs2_sigcode.s | 98 ++++++
sys/arch/i386/i386/svr4_sigcode.s | 4 +-
sys/arch/i386/pci/pcibios.c | 593 +++++++++++++++++++++++++++++++++++++
4 files changed, 871 insertions(+), 2 deletions(-)
diffs (truncated from 899 to 300 lines):
diff -r 87b45b012c80 -r c54b931999c0 sys/arch/i386/i386/bios32.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/i386/i386/bios32.c Sun Feb 24 01:55:11 2002 +0000
@@ -0,0 +1,178 @@
+/* $NetBSD: bios32.c,v 1.5.2.2 2002/02/24 01:55:12 sommerfeld Exp $ */
+
+/*-
+ * Copyright (c) 1999 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
+ * NASA Ames Research Center.
+ *
+ * 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.
+ */
+
+/*
+ * Copyright (c) 1999, by UCHIYAMA Yasushi
+ * All rights reserved.
+ *
+ * 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. The name of the developer may NOT be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
+ */
+
+/*
+ * Basic interface to BIOS32 services.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: bios32.c,v 1.5.2.2 2002/02/24 01:55:12 sommerfeld Exp $");
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/device.h>
+#include <sys/malloc.h>
+
+#include <dev/isa/isareg.h>
+#include <machine/isa_machdep.h>
+
+#include <machine/segments.h>
+#include <machine/bios32.h>
+
+#define BIOS32_START 0xe0000
+#define BIOS32_SIZE 0x20000
+#define BIOS32_END (BIOS32_START + BIOS32_SIZE - 0x10)
+
+struct bios32_entry bios32_entry;
+
+/*
+ * Initialize the BIOS32 interface.
+ */
+void
+bios32_init()
+{
+ paddr_t entry = 0;
+ caddr_t p;
+ unsigned char cksum;
+ int i;
+
+ for (p = (caddr_t)ISA_HOLE_VADDR(BIOS32_START);
+ p < (caddr_t)ISA_HOLE_VADDR(BIOS32_END);
+ p += 16) {
+ if (*(int *)p != BIOS32_MAKESIG('_', '3', '2', '_'))
+ continue;
+
+ cksum = 0;
+ for (i = 0; i < 16; i++)
+ cksum += *(unsigned char *)(p + i);
+ if (cksum != 0)
+ continue;
+
+ if (*(p + 9) != 1)
+ continue;
+
+ entry = *(u_int32_t *)(p + 4);
+
+ printf("BIOS32 rev. %d found at 0x%lx\n",
+ *(p + 8), entry);
+
+ if (entry < BIOS32_START ||
+ entry >= BIOS32_END) {
+ printf("BIOS32 entry point outside "
+ "allowable range\n");
+ entry = 0;
+ }
+ break;
+ }
+
+ if (entry != 0) {
+ bios32_entry.offset = (caddr_t)ISA_HOLE_VADDR(entry);
+ bios32_entry.segment = GSEL(GCODE_SEL, SEL_KPL);
+ }
+}
+
+/*
+ * Call BIOS32 to locate the specified BIOS32 service, and fill
+ * in the entry point information.
+ */
+int
+bios32_service(service, e, ei)
+ u_int32_t service;
+ bios32_entry_t e;
+ bios32_entry_info_t ei;
+{
+ u_int32_t eax, ebx, ecx, edx;
+ paddr_t entry;
+
+ if (bios32_entry.offset == 0)
+ return (0); /* BIOS32 not present */
+
+ __asm __volatile("lcall *(%%edi)"
+ : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx)
+ : "0" (service), "1" (0), "D" (&bios32_entry));
+
+ if ((eax & 0xff) != 0)
+ return (0); /* service not found */
+
+ entry = ebx + edx;
+
+ if (entry < BIOS32_START || entry >= BIOS32_END) {
+ printf("bios32: entry point for service %c%c%c%c is outside "
+ "allowable range\n",
+ service & 0xff,
+ (service >> 8) & 0xff,
+ (service >> 16) & 0xff,
+ (service >> 24) & 0xff);
+ return (0);
+ }
+
+ e->offset = (caddr_t)ISA_HOLE_VADDR(entry);
+ e->segment = GSEL(GCODE_SEL, SEL_KPL);
+
+ ei->bei_base = ebx;
+ ei->bei_size = ecx;
+ ei->bei_entry = entry;
+
+ return (1);
+}
diff -r 87b45b012c80 -r c54b931999c0 sys/arch/i386/i386/ibcs2_sigcode.s
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/i386/i386/ibcs2_sigcode.s Sun Feb 24 01:55:11 2002 +0000
@@ -0,0 +1,98 @@
+/* $NetBSD: ibcs2_sigcode.s,v 1.4.2.2 2002/02/24 01:55:12 sommerfeld Exp $ */
+
+/*-
+ * Copyright (c) 1998 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Charles M. Hannum.
+ *
+ * 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.
+ */
+
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * William Jolitz.
+ *
+ * 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 University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
+ *
+ * @(#)locore.s 7.3 (Berkeley) 5/13/91
+ */
+
+#if defined(_KERNEL_OPT)
+#include "opt_vm86.h"
+#endif
+
+#include "assym.h"
+
+#include <machine/asm.h>
+#include <compat/ibcs2/ibcs2_syscall.h>
+
+/* LINTSTUB: Var: char ibcs2_sigcode[1], ibcs2_esigcode[1]; */
+NENTRY(ibcs2_sigcode)
+ call *SIGF_HANDLER(%esp)
+ leal SIGF_SC(%esp),%eax # scp (the call may have clobbered the
+ # copy at SIGF_SCP(%esp))
+ pushl %eax
+ pushl %eax # junk to fake return address
+ movl $IBCS2_SYS_sigreturn,%eax
+ int $0x80 # enter kernel with args on stack
+ movl $IBCS2_SYS_exit,%eax
+ int $0x80 # exit if sigreturn fails
+ .globl _C_LABEL(ibcs2_esigcode)
+_C_LABEL(ibcs2_esigcode):
diff -r 87b45b012c80 -r c54b931999c0 sys/arch/i386/i386/svr4_sigcode.s
--- a/sys/arch/i386/i386/svr4_sigcode.s Sun Feb 24 01:51:05 2002 +0000
+++ b/sys/arch/i386/i386/svr4_sigcode.s Sun Feb 24 01:55:11 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: svr4_sigcode.s,v 1.1.4.8 2001/12/29 23:31:04 sommerfeld Exp $ */
+/* $NetBSD: svr4_sigcode.s,v 1.1.4.9 2002/02/24 01:55:11 sommerfeld Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -130,7 +130,7 @@
pushl %fs ; \
pushl %gs ; \
movw %ax,%gs ; \
- movw $GSEL(GCPU_SEL, SEL_KPL),%eax ; \
+ movw $GSEL(GCPU_SEL, SEL_KPL),%ax ; \
movw %ax,%fs
Home |
Main Index |
Thread Index |
Old Index