PERFORCE change 36731 for review
Marcel Moolenaar
marcel at FreeBSD.org
Fri Aug 22 22:33:56 PDT 2003
http://perforce.freebsd.org/chv.cgi?CH=36731
Change 36731 by marcel at marcel_nfs on 2003/08/22 22:33:13
IFC @36730
Affected files ...
.. //depot/projects/uart/amd64/amd64/amd64_mem.c#2 integrate
.. //depot/projects/uart/amd64/ia32/Makefile#2 delete
.. //depot/projects/uart/amd64/ia32/ia32.h#2 delete
.. //depot/projects/uart/amd64/ia32/ia32_genassym.c#3 delete
.. //depot/projects/uart/amd64/ia32/ia32_misc.c#3 delete
.. //depot/projects/uart/amd64/ia32/ia32_proto.h#3 delete
.. //depot/projects/uart/amd64/ia32/ia32_signal.c#3 integrate
.. //depot/projects/uart/amd64/ia32/ia32_signal.h#2 delete
.. //depot/projects/uart/amd64/ia32/ia32_sigtramp.S#2 delete
.. //depot/projects/uart/amd64/ia32/ia32_syscall.c#3 integrate
.. //depot/projects/uart/amd64/ia32/ia32_syscall.h#3 delete
.. //depot/projects/uart/amd64/ia32/ia32_syscalls.c#3 delete
.. //depot/projects/uart/amd64/ia32/ia32_sysent.c#3 delete
.. //depot/projects/uart/amd64/ia32/ia32_sysvec.c#3 delete
.. //depot/projects/uart/amd64/ia32/ia32_util.h#2 delete
.. //depot/projects/uart/amd64/ia32/syscalls.conf#2 delete
.. //depot/projects/uart/amd64/ia32/syscalls.master#3 delete
.. //depot/projects/uart/compat/freebsd32/Makefile#2 integrate
.. //depot/projects/uart/compat/freebsd32/freebsd32.h#2 integrate
.. //depot/projects/uart/compat/freebsd32/freebsd32_misc.c#2 integrate
.. //depot/projects/uart/compat/freebsd32/freebsd32_proto.h#2 integrate
.. //depot/projects/uart/compat/freebsd32/freebsd32_syscall.h#2 integrate
.. //depot/projects/uart/compat/freebsd32/freebsd32_syscalls.c#2 integrate
.. //depot/projects/uart/compat/freebsd32/freebsd32_sysent.c#2 integrate
.. //depot/projects/uart/compat/freebsd32/freebsd32_util.h#1 branch
.. //depot/projects/uart/compat/freebsd32/syscalls.conf#1 branch
.. //depot/projects/uart/compat/freebsd32/syscalls.master#1 branch
.. //depot/projects/uart/compat/ia32/ia32_genassym.c#1 branch
.. //depot/projects/uart/compat/ia32/ia32_signal.h#1 branch
.. //depot/projects/uart/compat/ia32/ia32_sigtramp.S#1 branch
.. //depot/projects/uart/compat/ia32/ia32_sysvec.c#1 branch
.. //depot/projects/uart/compat/ia32/ia32_util.h#1 branch
.. //depot/projects/uart/conf/files.amd64#4 integrate
.. //depot/projects/uart/conf/files.ia64#7 integrate
.. //depot/projects/uart/conf/options.ia64#3 integrate
.. //depot/projects/uart/dev/hfa/hfa_sbus.c#2 integrate
.. //depot/projects/uart/dev/hme/if_hme_sbus.c#2 integrate
.. //depot/projects/uart/dev/isp/isp_sbus.c#3 integrate
.. //depot/projects/uart/dev/sab/sab.c#2 integrate
.. //depot/projects/uart/dev/sio/sio_ebus.c#2 integrate
.. //depot/projects/uart/dev/zs/zs_macio.c#2 integrate
.. //depot/projects/uart/dev/zs/zs_sbus.c#2 integrate
.. //depot/projects/uart/gnu/ext2fs/ext2_linux_balloc.c#2 integrate
.. //depot/projects/uart/gnu/ext2fs/ext2_linux_ialloc.c#2 integrate
.. //depot/projects/uart/gnu/ext2fs/ia64-bitops.h#1 branch
.. //depot/projects/uart/ia64/ia64/machdep.c#9 integrate
.. //depot/projects/uart/ia64/include/param.h#3 integrate
.. //depot/projects/uart/pci/ncr.c#4 integrate
.. //depot/projects/uart/sparc64/ebus/ebus.c#4 integrate
.. //depot/projects/uart/sparc64/isa/isa.c#4 integrate
.. //depot/projects/uart/sparc64/isa/ofw_isa.c#4 integrate
.. //depot/projects/uart/sparc64/pci/psycho.c#4 integrate
.. //depot/projects/uart/sparc64/sbus/sbus.c#4 integrate
.. //depot/projects/uart/sparc64/sparc64/eeprom.c#2 integrate
.. //depot/projects/uart/sparc64/sparc64/eeprom_ebus.c#2 integrate
.. //depot/projects/uart/sparc64/sparc64/eeprom_fhc.c#2 integrate
.. //depot/projects/uart/sparc64/sparc64/eeprom_sbus.c#2 integrate
.. //depot/projects/uart/sparc64/sparc64/ofw_bus.c#4 integrate
.. //depot/projects/uart/sparc64/sparc64/ofw_machdep.c#3 integrate
Differences ...
==== //depot/projects/uart/amd64/amd64/amd64_mem.c#2 (text+ko) ====
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/amd64_mem.c,v 1.20 2003/06/02 06:43:14 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/amd64_mem.c,v 1.21 2003/08/23 00:27:58 peter Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -40,10 +40,10 @@
#include <machine/specialreg.h>
/*
- * i686 memory range operations
+ * amd64 memory range operations
*
* This code will probably be impenetrable without reference to the
- * Intel Pentium Pro documentation.
+ * Intel Pentium Pro documentation or x86-64 programmers manual vol 2.
*/
static char *mem_owner_bios = "BIOS";
@@ -66,18 +66,18 @@
static int mtrrs_disabled;
TUNABLE_INT("machdep.disable_mtrrs", &mtrrs_disabled);
SYSCTL_INT(_machdep, OID_AUTO, disable_mtrrs, CTLFLAG_RD,
- &mtrrs_disabled, 0, "Disable i686 MTRRs.");
+ &mtrrs_disabled, 0, "Disable amd64 MTRRs.");
-static void i686_mrinit(struct mem_range_softc *sc);
-static int i686_mrset(struct mem_range_softc *sc,
+static void amd64_mrinit(struct mem_range_softc *sc);
+static int amd64_mrset(struct mem_range_softc *sc,
struct mem_range_desc *mrd,
int *arg);
-static void i686_mrAPinit(struct mem_range_softc *sc);
+static void amd64_mrAPinit(struct mem_range_softc *sc);
-static struct mem_range_ops i686_mrops = {
- i686_mrinit,
- i686_mrset,
- i686_mrAPinit
+static struct mem_range_ops amd64_mrops = {
+ amd64_mrinit,
+ amd64_mrset,
+ amd64_mrAPinit
};
/* XXX for AP startup hook */
@@ -85,23 +85,23 @@
static struct mem_range_desc *mem_range_match(struct mem_range_softc *sc,
struct mem_range_desc *mrd);
-static void i686_mrfetch(struct mem_range_softc *sc);
-static int i686_mtrrtype(int flags);
-static int i686_mrt2mtrr(int flags, int oldval);
-static int i686_mtrrconflict(int flag1, int flag2);
-static void i686_mrstore(struct mem_range_softc *sc);
-static void i686_mrstoreone(void *arg);
-static struct mem_range_desc *i686_mtrrfixsearch(struct mem_range_softc *sc,
+static void amd64_mrfetch(struct mem_range_softc *sc);
+static int amd64_mtrrtype(int flags);
+static int amd64_mrt2mtrr(int flags, int oldval);
+static int amd64_mtrrconflict(int flag1, int flag2);
+static void amd64_mrstore(struct mem_range_softc *sc);
+static void amd64_mrstoreone(void *arg);
+static struct mem_range_desc *amd64_mtrrfixsearch(struct mem_range_softc *sc,
u_int64_t addr);
-static int i686_mrsetlow(struct mem_range_softc *sc,
+static int amd64_mrsetlow(struct mem_range_softc *sc,
struct mem_range_desc *mrd,
int *arg);
-static int i686_mrsetvariable(struct mem_range_softc *sc,
+static int amd64_mrsetvariable(struct mem_range_softc *sc,
struct mem_range_desc *mrd,
int *arg);
-/* i686 MTRR type to memory range type conversion */
-static int i686_mtrrtomrt[] = {
+/* amd64 MTRR type to memory range type conversion */
+static int amd64_mtrrtomrt[] = {
MDF_UNCACHEABLE,
MDF_WRITECOMBINE,
MDF_UNKNOWN,
@@ -111,22 +111,26 @@
MDF_WRITEBACK
};
-#define MTRRTOMRTLEN (sizeof(i686_mtrrtomrt) / sizeof(i686_mtrrtomrt[0]))
+#define MTRRTOMRTLEN (sizeof(amd64_mtrrtomrt) / sizeof(amd64_mtrrtomrt[0]))
static int
-i686_mtrr2mrt(int val) {
+amd64_mtrr2mrt(int val)
+{
if (val < 0 || val >= MTRRTOMRTLEN)
return MDF_UNKNOWN;
- return i686_mtrrtomrt[val];
+ return amd64_mtrrtomrt[val];
}
/*
- * i686 MTRR conflicts. Writeback and uncachable may overlap.
+ * amd64 MTRR conflicts. Writeback and uncachable may overlap.
*/
static int
-i686_mtrrconflict(int flag1, int flag2) {
+amd64_mtrrconflict(int flag1, int flag2)
+{
flag1 &= MDF_ATTRMASK;
flag2 &= MDF_ATTRMASK;
+ if ((flag1 & MDF_UNKNOWN) || (flag2 & MDF_UNKNOWN))
+ return 1;
if (flag1 == flag2 ||
(flag1 == MDF_WRITEBACK && flag2 == MDF_UNCACHEABLE) ||
(flag2 == MDF_WRITEBACK && flag1 == MDF_UNCACHEABLE))
@@ -156,7 +160,7 @@
* that MTRRs are enabled, and we may or may not have fixed MTRRs.
*/
static void
-i686_mrfetch(struct mem_range_softc *sc)
+amd64_mrfetch(struct mem_range_softc *sc)
{
struct mem_range_desc *mrd;
u_int64_t msrv;
@@ -171,7 +175,7 @@
msrv = rdmsr(msr);
for (j = 0; j < 8; j++, mrd++) {
mrd->mr_flags = (mrd->mr_flags & ~MDF_ATTRMASK) |
- i686_mtrr2mrt(msrv & 0xff) |
+ amd64_mtrr2mrt(msrv & 0xff) |
MDF_ACTIVE;
if (mrd->mr_owner[0] == 0)
strcpy(mrd->mr_owner, mem_owner_bios);
@@ -183,7 +187,7 @@
msrv = rdmsr(msr);
for (j = 0; j < 8; j++, mrd++) {
mrd->mr_flags = (mrd->mr_flags & ~MDF_ATTRMASK) |
- i686_mtrr2mrt(msrv & 0xff) |
+ amd64_mtrr2mrt(msrv & 0xff) |
MDF_ACTIVE;
if (mrd->mr_owner[0] == 0)
strcpy(mrd->mr_owner, mem_owner_bios);
@@ -195,7 +199,7 @@
msrv = rdmsr(msr);
for (j = 0; j < 8; j++, mrd++) {
mrd->mr_flags = (mrd->mr_flags & ~MDF_ATTRMASK) |
- i686_mtrr2mrt(msrv & 0xff) |
+ amd64_mtrr2mrt(msrv & 0xff) |
MDF_ACTIVE;
if (mrd->mr_owner[0] == 0)
strcpy(mrd->mr_owner, mem_owner_bios);
@@ -209,14 +213,14 @@
for (; (mrd - sc->mr_desc) < sc->mr_ndesc; msr += 2, mrd++) {
msrv = rdmsr(msr);
mrd->mr_flags = (mrd->mr_flags & ~MDF_ATTRMASK) |
- i686_mtrr2mrt(msrv & 0xff);
- mrd->mr_base = msrv & 0x0000000ffffff000LL;
+ amd64_mtrr2mrt(msrv & 0xff);
+ mrd->mr_base = msrv & 0x000ffffffffff000L;
msrv = rdmsr(msr + 1);
mrd->mr_flags = (msrv & 0x800) ?
(mrd->mr_flags | MDF_ACTIVE) :
(mrd->mr_flags & ~MDF_ACTIVE);
/* Compute the range from the mask. Ick. */
- mrd->mr_len = (~(msrv & 0x0000000ffffff000LL) & 0x0000000fffffffffLL) + 1;
+ mrd->mr_len = (~(msrv & 0x000ffffffffff000L) & 0x000fffffffffffffL) + 1;
if (!mrvalid(mrd->mr_base, mrd->mr_len))
mrd->mr_flags |= MDF_BOGUS;
/* If unclaimed and active, must be the BIOS */
@@ -229,27 +233,27 @@
* Return the MTRR memory type matching a region's flags
*/
static int
-i686_mtrrtype(int flags)
+amd64_mtrrtype(int flags)
{
int i;
flags &= MDF_ATTRMASK;
for (i = 0; i < MTRRTOMRTLEN; i++) {
- if (i686_mtrrtomrt[i] == MDF_UNKNOWN)
+ if (amd64_mtrrtomrt[i] == MDF_UNKNOWN)
continue;
- if (flags == i686_mtrrtomrt[i])
+ if (flags == amd64_mtrrtomrt[i])
return(i);
}
return(-1);
}
static int
-i686_mrt2mtrr(int flags, int oldval)
+amd64_mrt2mtrr(int flags, int oldval)
{
int val;
- if ((val = i686_mtrrtype(flags)) == -1)
+ if ((val = amd64_mtrrtype(flags)) == -1)
return oldval & 0xff;
return val & 0xff;
}
@@ -261,7 +265,7 @@
* XXX Must be called with interrupts enabled.
*/
static void
-i686_mrstore(struct mem_range_softc *sc)
+amd64_mrstore(struct mem_range_softc *sc)
{
#ifdef SMP
/*
@@ -270,10 +274,10 @@
* The "proper" solution involves a generalised locking gate
* implementation, not ready yet.
*/
- smp_rendezvous(NULL, i686_mrstoreone, NULL, (void *)sc);
+ smp_rendezvous(NULL, amd64_mrstoreone, NULL, (void *)sc);
#else
disable_intr(); /* disable interrupts */
- i686_mrstoreone((void *)sc);
+ amd64_mrstoreone((void *)sc);
enable_intr();
#endif
}
@@ -284,7 +288,7 @@
* just stuffing one entry; this is simpler (but slower, of course).
*/
static void
-i686_mrstoreone(void *arg)
+amd64_mrstoreone(void *arg)
{
struct mem_range_softc *sc = (struct mem_range_softc *)arg;
struct mem_range_desc *mrd;
@@ -309,7 +313,7 @@
omsrv = rdmsr(msr);
for (j = 7; j >= 0; j--) {
msrv = msrv << 8;
- msrv |= i686_mrt2mtrr((mrd + j)->mr_flags, omsrv >> (j*8));
+ msrv |= amd64_mrt2mtrr((mrd + j)->mr_flags, omsrv >> (j*8));
}
wrmsr(msr, msrv);
mrd += 8;
@@ -320,7 +324,7 @@
omsrv = rdmsr(msr);
for (j = 7; j >= 0; j--) {
msrv = msrv << 8;
- msrv |= i686_mrt2mtrr((mrd + j)->mr_flags, omsrv >> (j*8));
+ msrv |= amd64_mrt2mtrr((mrd + j)->mr_flags, omsrv >> (j*8));
}
wrmsr(msr, msrv);
mrd += 8;
@@ -331,7 +335,7 @@
omsrv = rdmsr(msr);
for (j = 7; j >= 0; j--) {
msrv = msrv << 8;
- msrv |= i686_mrt2mtrr((mrd + j)->mr_flags, omsrv >> (j*8));
+ msrv |= amd64_mrt2mtrr((mrd + j)->mr_flags, omsrv >> (j*8));
}
wrmsr(msr, msrv);
mrd += 8;
@@ -344,8 +348,8 @@
/* base/type register */
omsrv = rdmsr(msr);
if (mrd->mr_flags & MDF_ACTIVE) {
- msrv = mrd->mr_base & 0x0000000ffffff000LL;
- msrv |= i686_mrt2mtrr(mrd->mr_flags, omsrv);
+ msrv = mrd->mr_base & 0x000ffffffffff000L;
+ msrv |= amd64_mrt2mtrr(mrd->mr_flags, omsrv);
} else {
msrv = 0;
}
@@ -353,7 +357,7 @@
/* mask/active register */
if (mrd->mr_flags & MDF_ACTIVE) {
- msrv = 0x800 | (~(mrd->mr_len - 1) & 0x0000000ffffff000LL);
+ msrv = 0x800 | (~(mrd->mr_len - 1) & 0x000ffffffffff000L);
} else {
msrv = 0;
}
@@ -369,7 +373,7 @@
* Hunt for the fixed MTRR referencing (addr)
*/
static struct mem_range_desc *
-i686_mtrrfixsearch(struct mem_range_softc *sc, u_int64_t addr)
+amd64_mtrrfixsearch(struct mem_range_softc *sc, u_int64_t addr)
{
struct mem_range_desc *mrd;
int i;
@@ -391,13 +395,13 @@
* XXX note that this will have to be updated when we start supporting "busy" ranges.
*/
static int
-i686_mrsetlow(struct mem_range_softc *sc, struct mem_range_desc *mrd, int *arg)
+amd64_mrsetlow(struct mem_range_softc *sc, struct mem_range_desc *mrd, int *arg)
{
struct mem_range_desc *first_md, *last_md, *curr_md;
/* range check */
- if (((first_md = i686_mtrrfixsearch(sc, mrd->mr_base)) == NULL) ||
- ((last_md = i686_mtrrfixsearch(sc, mrd->mr_base + mrd->mr_len - 1)) == NULL))
+ if (((first_md = amd64_mtrrfixsearch(sc, mrd->mr_base)) == NULL) ||
+ ((last_md = amd64_mtrrfixsearch(sc, mrd->mr_base + mrd->mr_len - 1)) == NULL))
return(EINVAL);
/* check we aren't doing something risky */
@@ -423,7 +427,7 @@
* XXX needs to be updated to properly support "busy" ranges.
*/
static int
-i686_mrsetvariable(struct mem_range_softc *sc, struct mem_range_desc *mrd, int *arg)
+amd64_mrsetvariable(struct mem_range_softc *sc, struct mem_range_desc *mrd, int *arg)
{
struct mem_range_desc *curr_md, *free_md;
int i;
@@ -457,7 +461,7 @@
/* non-exact overlap ? */
if (mroverlap(curr_md, mrd)) {
/* between conflicting region types? */
- if (i686_mtrrconflict(curr_md->mr_flags, mrd->mr_flags))
+ if (amd64_mtrrconflict(curr_md->mr_flags, mrd->mr_flags))
return(EINVAL);
}
} else if (free_md == NULL) {
@@ -481,7 +485,7 @@
*
*/
static int
-i686_mrset(struct mem_range_softc *sc, struct mem_range_desc *mrd, int *arg)
+amd64_mrset(struct mem_range_softc *sc, struct mem_range_desc *mrd, int *arg)
{
struct mem_range_desc *targ;
int error = 0;
@@ -490,7 +494,7 @@
case MEMRANGE_SET_UPDATE:
/* make sure that what's being asked for is even possible at all */
if (!mrvalid(mrd->mr_base, mrd->mr_len) ||
- i686_mtrrtype(mrd->mr_flags) == -1)
+ amd64_mtrrtype(mrd->mr_flags) == -1)
return(EINVAL);
#define FIXTOP ((MTRR_N64K * 0x10000) + (MTRR_N16K * 0x4000) + (MTRR_N4K * 0x1000))
@@ -498,11 +502,11 @@
/* are the "low memory" conditions applicable? */
if ((sc->mr_cap & MR686_FIXMTRR) &&
((mrd->mr_base + mrd->mr_len) <= FIXTOP)) {
- if ((error = i686_mrsetlow(sc, mrd, arg)) != 0)
+ if ((error = amd64_mrsetlow(sc, mrd, arg)) != 0)
return(error);
} else {
/* it's time to play with variable MTRRs */
- if ((error = i686_mrsetvariable(sc, mrd, arg)) != 0)
+ if ((error = amd64_mrsetvariable(sc, mrd, arg)) != 0)
return(error);
}
break;
@@ -523,8 +527,8 @@
}
/* update the hardware */
- i686_mrstore(sc);
- i686_mrfetch(sc); /* refetch to see where we're at */
+ amd64_mrstore(sc);
+ amd64_mrfetch(sc); /* refetch to see where we're at */
return(0);
}
@@ -533,7 +537,7 @@
* fetch the initial settings.
*/
static void
-i686_mrinit(struct mem_range_softc *sc)
+amd64_mrinit(struct mem_range_softc *sc)
{
struct mem_range_desc *mrd;
int nmdesc = 0;
@@ -587,7 +591,7 @@
* Get current settings, anything set now is considered to have
* been set by the firmware. (XXX has something already played here?)
*/
- i686_mrfetch(sc);
+ amd64_mrfetch(sc);
mrd = sc->mr_desc;
for (i = 0; i < sc->mr_ndesc; i++, mrd++) {
if (mrd->mr_flags & MDF_ACTIVE)
@@ -599,24 +603,25 @@
* Initialise MTRRs on an AP after the BSP has run the init code.
*/
static void
-i686_mrAPinit(struct mem_range_softc *sc)
+amd64_mrAPinit(struct mem_range_softc *sc)
{
- i686_mrstoreone((void *)sc); /* set MTRRs to match BSP */
+ amd64_mrstoreone((void *)sc); /* set MTRRs to match BSP */
wrmsr(MSR_MTRRdefType, mtrrdef); /* set MTRR behaviour to match BSP */
}
static void
-i686_mem_drvinit(void *unused)
+amd64_mem_drvinit(void *unused)
{
- /* Try for i686 MTRRs */
- if (!mtrrs_disabled && (cpu_feature & CPUID_MTRR) &&
- ((cpu_id & 0xf00) == 0x600 || (cpu_id & 0xf00) == 0xf00) &&
- ((strcmp(cpu_vendor, "GenuineIntel") == 0) ||
- (strcmp(cpu_vendor, "AuthenticAMD") == 0))) {
- mem_range_softc.mr_op = &i686_mrops;
- }
+ if (mtrrs_disabled)
+ return;
+ if (!(cpu_feature & CPUID_MTRR))
+ return;
+ if ((cpu_id & 0xf00) != 0x600 && (cpu_id & 0xf00) != 0xf00)
+ return;
+ if ((strcmp(cpu_vendor, "GenuineIntel") != 0) &&
+ (strcmp(cpu_vendor, "AuthenticAMD") != 0))
+ return;
+ mem_range_softc.mr_op = &amd64_mrops;
}
-SYSINIT(i686memdev,SI_SUB_DRIVERS,SI_ORDER_FIRST,i686_mem_drvinit,NULL)
-
-
+SYSINIT(amd64memdev,SI_SUB_DRIVERS,SI_ORDER_FIRST,amd64_mem_drvinit,NULL)
==== //depot/projects/uart/amd64/ia32/ia32_signal.c#3 (text+ko) ====
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/ia32/ia32_signal.c,v 1.3 2003/07/25 21:16:26 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/ia32/ia32_signal.c,v 1.4 2003/08/23 00:04:53 peter Exp $");
#include "opt_compat.h"
@@ -71,9 +71,9 @@
#include <vm/vm_object.h>
#include <vm/vm_extern.h>
-#include <amd64/ia32/ia32_util.h>
-#include <amd64/ia32/ia32_proto.h>
-#include <amd64/ia32/ia32_signal.h>
+#include <compat/freebsd32/freebsd32_util.h>
+#include <compat/freebsd32/freebsd32_proto.h>
+#include <compat/ia32/ia32_signal.h>
#include <machine/psl.h>
#include <machine/segments.h>
#include <machine/specialreg.h>
@@ -264,7 +264,7 @@
}
regs->tf_rsp = (uintptr_t)sfp;
- regs->tf_rip = IA32_PS_STRINGS - sz_freebsd4_ia32_sigcode;
+ regs->tf_rip = FREEBSD32_PS_STRINGS - sz_freebsd4_ia32_sigcode;
regs->tf_rflags &= ~PSL_T;
regs->tf_cs = _ucode32sel;
regs->tf_ss = _udatasel;
@@ -380,7 +380,7 @@
}
regs->tf_rsp = (uintptr_t)sfp;
- regs->tf_rip = IA32_PS_STRINGS - *(p->p_sysent->sv_szsigcode);
+ regs->tf_rip = FREEBSD32_PS_STRINGS - *(p->p_sysent->sv_szsigcode);
regs->tf_rflags &= ~PSL_T;
regs->tf_cs = _ucode32sel;
regs->tf_ss = _udatasel;
@@ -406,10 +406,10 @@
* MPSAFE
*/
int
-freebsd4_ia32_sigreturn(td, uap)
+freebsd4_freebsd32_sigreturn(td, uap)
struct thread *td;
- struct freebsd4_ia32_sigreturn_args /* {
- const struct freebsd4_ucontext *sigcntxp;
+ struct freebsd4_freebsd32_sigreturn_args /* {
+ const struct freebsd4_freebsd32_ucontext *sigcntxp;
} */ *uap;
{
struct ia32_ucontext4 uc;
@@ -438,7 +438,7 @@
* one less debugger trap, so allowing it is fairly harmless.
*/
if (!EFL_SECURE(eflags & ~PSL_RF, regs->tf_rflags & ~PSL_RF)) {
- printf("freebsd4_ia32_sigreturn: eflags = 0x%x\n", eflags);
+ printf("freebsd4_freebsd32_sigreturn: eflags = 0x%x\n", eflags);
return (EINVAL);
}
@@ -483,10 +483,10 @@
* MPSAFE
*/
int
-ia32_sigreturn(td, uap)
+freebsd32_sigreturn(td, uap)
struct thread *td;
- struct ia32_sigreturn_args /* {
- const struct ia32_ucontext *sigcntxp;
+ struct freebsd32_sigreturn_args /* {
+ const struct freebsd32_ucontext *sigcntxp;
} */ *uap;
{
struct ia32_ucontext uc;
@@ -515,7 +515,7 @@
* one less debugger trap, so allowing it is fairly harmless.
*/
if (!EFL_SECURE(eflags & ~PSL_RF, regs->tf_rflags & ~PSL_RF)) {
- printf("ia32_sigreturn: eflags = 0x%x\n", eflags);
+ printf("freebsd32_sigreturn: eflags = 0x%x\n", eflags);
return (EINVAL);
}
==== //depot/projects/uart/amd64/ia32/ia32_syscall.c#3 (text+ko) ====
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/ia32/ia32_syscall.c,v 1.3 2003/07/25 21:16:26 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/ia32/ia32_syscall.c,v 1.4 2003/08/23 00:04:53 peter Exp $");
/*
* 386 Trap and System call handling
@@ -84,7 +84,7 @@
#define IDTVEC(name) __CONCAT(X,name)
extern inthand_t IDTVEC(int0x80_syscall), IDTVEC(rsvd);
-extern const char *ia32_syscallnames[];
+extern const char *freebsd32_syscallnames[];
void ia32_syscall(struct trapframe frame); /* Called from asm code */
@@ -253,7 +253,7 @@
cred_free_thread(td);
#endif
WITNESS_WARN(WARN_PANIC, NULL, "System call %s returning",
- (code >= 0 && code < SYS_MAXSYSCALL) ? ia32_syscallnames[code] : "???");
+ (code >= 0 && code < SYS_MAXSYSCALL) ? freebsd32_syscallnames[code] : "???");
mtx_assert(&sched_lock, MA_NOTOWNED);
mtx_assert(&Giant, MA_NOTOWNED);
}
==== //depot/projects/uart/compat/freebsd32/Makefile#2 (text+ko) ====
@@ -1,16 +1,16 @@
# Makefile for syscall tables
#
-# $FreeBSD: src/sys/compat/freebsd32/Makefile,v 1.2 2003/05/31 06:49:53 peter Exp $
+# $FreeBSD: src/sys/compat/freebsd32/Makefile,v 1.3 2003/08/22 22:51:48 peter Exp $
all:
@echo "make sysent only"
-sysent: ia32_sysent.c ia32_syscall.h ia32_proto.h
+sysent: freebsd32_sysent.c freebsd32_syscall.h freebsd32_proto.h
-ia32_sysent.c ia32_syscalls.c ia32_syscall.h ia32_proto.h: ../../kern/makesyscalls.sh \
- syscalls.master syscalls.conf
- -mv -f ia32_sysent.c ia32_sysent.c.bak
- -mv -f ia32_syscalls.c ia32_syscalls.c.bak
- -mv -f ia32_syscall.h ia32_syscall.h.bak
- -mv -f ia32_proto.h ia32_proto.h.bak
+freebsd32_sysent.c freebsd32_syscalls.c freebsd32_syscall.h freebsd32_proto.h: \
+ ../../kern/makesyscalls.sh syscalls.master syscalls.conf
+ -mv -f freebsd32_sysent.c freebsd32_sysent.c.bak
+ -mv -f freebsd32_syscalls.c freebsd32_syscalls.c.bak
+ -mv -f freebsd32_syscall.h freebsd32_syscall.h.bak
+ -mv -f freebsd32_proto.h freebsd32_proto.h.bak
sh ../../kern/makesyscalls.sh syscalls.master syscalls.conf
==== //depot/projects/uart/compat/freebsd32/freebsd32.h#2 (text+ko) ====
@@ -23,11 +23,11 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/compat/freebsd32/freebsd32.h,v 1.1 2002/07/20 02:56:10 peter Exp $
+ * $FreeBSD: src/sys/compat/freebsd32/freebsd32.h,v 1.2 2003/08/22 23:07:28 peter Exp $
*/
-#ifndef _IA64_IA32_IA32_H_
-#define _IA64_IA32_IA32_H_
+#ifndef _COMPAT_FREEBSD32_FREEBSD32_H_
+#define _COMPAT_FREEBSD32_FREEBSD32_H_
#define PTRIN(v) (void *)(uintptr_t) (v)
#define PTROUT(v) (u_int32_t)(uintptr_t) (v)
@@ -100,4 +100,4 @@
int32_t f_spare[2];
};
-#endif /* !_IA64_IA32_IA32_H_ */
+#endif /* !_COMPAT_FREEBSD32_FREEBSD32_H_ */
==== //depot/projects/uart/compat/freebsd32/freebsd32_misc.c#2 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/freebsd32/freebsd32_misc.c,v 1.11 2003/07/25 21:16:26 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/freebsd32/freebsd32_misc.c,v 1.13 2003/08/23 00:04:52 peter Exp $");
#include "opt_compat.h"
@@ -75,11 +75,10 @@
#include <vm/vm_object.h>
#include <vm/vm_extern.h>
-#include <amd64/ia32/ia32_util.h>
-#include <amd64/ia32/ia32.h>
-#include <amd64/ia32/ia32_proto.h>
+#include <compat/freebsd32/freebsd32_util.h>
+#include <compat/freebsd32/freebsd32.h>
+#include <compat/freebsd32/freebsd32_proto.h>
-static const char ia32_emul_path[] = "/compat/ia32";
/*
* [ taken from the linux emulator ]
* Search an alternate path before passing pathname arguments on
@@ -90,7 +89,7 @@
* be in exists.
*/
int
-ia32_emul_find(td, sgp, prefix, path, pbuf, cflag)
+freebsd32_emul_find(td, sgp, prefix, path, pbuf, cflag)
struct thread *td;
caddr_t *sgp; /* Pointer to stackgap memory */
const char *prefix;
@@ -163,15 +162,15 @@
}
/*
- * We now compare the vnode of the ia32_root to the one
+ * We now compare the vnode of the freebsd32_root to the one
* vnode asked. If they resolve to be the same, then we
* ignore the match so that the real root gets used.
* This avoids the problem of traversing "../.." to find the
* root directory and never finding it, because "/" resolves
* to the emulation root directory. This is expensive :-(
*/
- NDINIT(&ndroot, LOOKUP, FOLLOW, UIO_SYSSPACE, ia32_emul_path,
- td);
+ NDINIT(&ndroot, LOOKUP, FOLLOW, UIO_SYSSPACE,
+ freebsd32_emul_path, td);
if ((error = namei(&ndroot)) != 0) {
/* Cannot happen! */
@@ -220,7 +219,7 @@
}
int
-ia32_open(struct thread *td, struct ia32_open_args *uap)
+freebsd32_open(struct thread *td, struct freebsd32_open_args *uap)
{
caddr_t sg;
@@ -231,7 +230,7 @@
}
int
-ia32_wait4(struct thread *td, struct ia32_wait4_args *uap)
+freebsd32_wait4(struct thread *td, struct freebsd32_wait4_args *uap)
{
int error;
caddr_t sg;
@@ -297,7 +296,7 @@
}
int
-ia32_getfsstat(struct thread *td, struct ia32_getfsstat_args *uap)
+freebsd32_getfsstat(struct thread *td, struct freebsd32_getfsstat_args *uap)
{
int error;
caddr_t sg;
@@ -330,7 +329,7 @@
}
int
-ia32_access(struct thread *td, struct ia32_access_args *uap)
+freebsd32_access(struct thread *td, struct freebsd32_access_args *uap)
{
caddr_t sg;
@@ -341,7 +340,7 @@
}
int
-ia32_chflags(struct thread *td, struct ia32_chflags_args *uap)
+freebsd32_chflags(struct thread *td, struct freebsd32_chflags_args *uap)
{
caddr_t sg;
@@ -358,7 +357,8 @@
};
int
-ia32_sigaltstack(struct thread *td, struct ia32_sigaltstack_args *uap)
+freebsd32_sigaltstack(struct thread *td,
+ struct freebsd32_sigaltstack_args *uap)
{
struct sigaltstack32 s32;
struct sigaltstack ss, oss, *ssp;
@@ -385,7 +385,7 @@
}
int
-ia32_execve(struct thread *td, struct ia32_execve_args *uap)
+freebsd32_execve(struct thread *td, struct freebsd32_execve_args *uap)
{
int error;
caddr_t sg;
@@ -442,8 +442,8 @@
#ifdef __ia64__
static int
-ia32_mmap_partial(struct thread *td, vm_offset_t start, vm_offset_t end,
- int prot, int fd, off_t pos)
+freebsd32_mmap_partial(struct thread *td, vm_offset_t start, vm_offset_t end,
+ int prot, int fd, off_t pos)
{
vm_map_t map;
vm_map_entry_t entry;
@@ -490,7 +490,7 @@
#endif
int
-ia32_mmap(struct thread *td, struct ia32_mmap_args *uap)
+freebsd32_mmap(struct thread *td, struct freebsd32_mmap_args *uap)
{
struct mmap_args ap;
vm_offset_t addr = (vm_offset_t) uap->addr;
@@ -514,15 +514,16 @@
end = addr + len;
if (start != trunc_page(start)) {
- error = ia32_mmap_partial(td, start, round_page(start),
- prot, fd, pos);
+ error = freebsd32_mmap_partial(td, start,
+ round_page(start), prot,
+ fd, pos);
if (fd != -1)
pos += round_page(start) - start;
start = round_page(start);
}
if (end != round_page(end)) {
vm_offset_t t = trunc_page(end);
- error = ia32_mmap_partial(td, t, end,
+ error = freebsd32_mmap_partial(td, t, end,
prot, fd,
pos + t - start);
end = trunc_page(end);
@@ -589,7 +590,7 @@
};
int
-ia32_setitimer(struct thread *td, struct ia32_setitimer_args *uap)
+freebsd32_setitimer(struct thread *td, struct freebsd32_setitimer_args *uap)
{
int error;
caddr_t sg;
@@ -631,7 +632,7 @@
}
int
-ia32_select(struct thread *td, struct ia32_select_args *uap)
+freebsd32_select(struct thread *td, struct freebsd32_select_args *uap)
{
int error;
caddr_t sg;
@@ -668,7 +669,7 @@
};
int
-ia32_kevent(struct thread *td, struct ia32_kevent_args *uap)
+freebsd32_kevent(struct thread *td, struct freebsd32_kevent_args *uap)
{
int error;
caddr_t sg;
@@ -700,9 +701,11 @@
return (error);
}
if (uap->changelist) {
- a.changelist = (struct kevent *)stackgap_alloc(&sg, uap->nchanges * sizeof(struct kevent));
+ a.changelist = (struct kevent *)stackgap_alloc(&sg,
+ uap->nchanges * sizeof(struct kevent));
for (i = 0; i < uap->nchanges; i++) {
- error = copyin(&uap->changelist[i], &ks32, sizeof(ks32));
+ error = copyin(&uap->changelist[i], &ks32,
+ sizeof(ks32));
if (error)
return (error);
ks = (struct kevent *)(uintptr_t)&a.changelist[i];
@@ -715,7 +718,8 @@
}
}
if (uap->eventlist) {
- a.eventlist = stackgap_alloc(&sg, uap->nevents * sizeof(struct kevent));
+ a.eventlist = stackgap_alloc(&sg,
+ uap->nevents * sizeof(struct kevent));
}
error = kevent(td, &a);
if (uap->eventlist && error > 0) {
@@ -727,7 +731,8 @@
CP(*ks, ks32, fflags);
CP(*ks, ks32, data);
PTROUT_CP(*ks, ks32, udata);
- error = copyout(&ks32, &uap->eventlist[i], sizeof(ks32));
+ error = copyout(&ks32, &uap->eventlist[i],
+ sizeof(ks32));
if (error)
return (error);
}
@@ -736,7 +741,8 @@
}
int
-ia32_gettimeofday(struct thread *td, struct ia32_gettimeofday_args *uap)
+freebsd32_gettimeofday(struct thread *td,
+ struct freebsd32_gettimeofday_args *uap)
{
int error;
caddr_t sg;
@@ -766,7 +772,7 @@
}
int
-ia32_getrusage(struct thread *td, struct ia32_getrusage_args *uap)
+freebsd32_getrusage(struct thread *td, struct freebsd32_getrusage_args *uap)
{
int error;
caddr_t sg;
@@ -814,7 +820,7 @@
#define STACKGAPLEN 400
int
-ia32_readv(struct thread *td, struct ia32_readv_args *uap)
+freebsd32_readv(struct thread *td, struct freebsd32_readv_args *uap)
{
int error, osize, nsize, i;
caddr_t sg;
@@ -860,7 +866,7 @@
}
int
-ia32_writev(struct thread *td, struct ia32_writev_args *uap)
+freebsd32_writev(struct thread *td, struct freebsd32_writev_args *uap)
{
int error, i, nsize, osize;
caddr_t sg;
@@ -906,7 +912,8 @@
}
int
-ia32_settimeofday(struct thread *td, struct ia32_settimeofday_args *uap)
+freebsd32_settimeofday(struct thread *td,
+ struct freebsd32_settimeofday_args *uap)
{
int error;
caddr_t sg;
@@ -931,7 +938,7 @@
}
int
-ia32_utimes(struct thread *td, struct ia32_utimes_args *uap)
+freebsd32_utimes(struct thread *td, struct freebsd32_utimes_args *uap)
{
int error;
caddr_t sg;
@@ -958,7 +965,7 @@
}
int
-ia32_adjtime(struct thread *td, struct ia32_adjtime_args *uap)
+freebsd32_adjtime(struct thread *td, struct freebsd32_adjtime_args *uap)
{
int error;
caddr_t sg;
@@ -1000,7 +1007,7 @@
}
int
-ia32_statfs(struct thread *td, struct ia32_statfs_args *uap)
+freebsd32_statfs(struct thread *td, struct freebsd32_statfs_args *uap)
{
int error;
caddr_t sg;
@@ -1027,7 +1034,7 @@
}
int
-ia32_fstatfs(struct thread *td, struct ia32_fstatfs_args *uap)
+freebsd32_fstatfs(struct thread *td, struct freebsd32_fstatfs_args *uap)
{
int error;
caddr_t sg;
@@ -1054,7 +1061,7 @@
}
int
-ia32_semsys(struct thread *td, struct ia32_semsys_args *uap)
+freebsd32_semsys(struct thread *td, struct freebsd32_semsys_args *uap)
{
/*
* Vector through to semsys if it is loaded.
@@ -1063,7 +1070,7 @@
}
int
-ia32_msgsys(struct thread *td, struct ia32_msgsys_args *uap)
+freebsd32_msgsys(struct thread *td, struct freebsd32_msgsys_args *uap)
{
/*
* Vector through to msgsys if it is loaded.
@@ -1072,7 +1079,7 @@
}
int
-ia32_shmsys(struct thread *td, struct ia32_shmsys_args *uap)
+freebsd32_shmsys(struct thread *td, struct freebsd32_shmsys_args *uap)
{
/*
* Vector through to shmsys if it is loaded.
@@ -1081,41 +1088,38 @@
}
int
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list