From 23efa1f8cad4808e0bed80b3ae06b8a4696eca7a Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Sun, 28 Jul 2002 00:27:51 +0000 Subject: [PATCH] Unwind the syscall_with_err_pushed tweak that jake did some time back. OK'ed by: jake --- sys/amd64/amd64/db_trace.c | 4 +++- sys/amd64/amd64/exception.S | 16 ++++++++++++++-- sys/amd64/amd64/exception.s | 16 ++++++++++++++-- sys/i386/i386/db_trace.c | 4 +++- sys/i386/i386/exception.s | 16 ++++++++++++++-- 5 files changed, 48 insertions(+), 8 deletions(-) diff --git a/sys/amd64/amd64/db_trace.c b/sys/amd64/amd64/db_trace.c index f34747cfda15..8ac4c01ab645 100644 --- a/sys/amd64/amd64/db_trace.c +++ b/sys/amd64/amd64/db_trace.c @@ -226,7 +226,9 @@ db_nextframe(fp, ip, p) } else if (!strncmp(name, "Xintr", 5) || !strncmp(name, "Xfastintr", 9)) { frame_type = INTERRUPT; - } else if (!strcmp(name, "syscall_with_err_pushed")) { + } else if (!strcmp(name, "Xlcall_syscall")) { + frame_type = SYSCALL; + } else if (!strcmp(name, "Xint0x80_syscall")) { frame_type = SYSCALL; } } diff --git a/sys/amd64/amd64/exception.S b/sys/amd64/amd64/exception.S index 89bfb136fa5d..8eeacbc3d5b9 100644 --- a/sys/amd64/amd64/exception.S +++ b/sys/amd64/amd64/exception.S @@ -191,7 +191,20 @@ IDTVEC(lcall_syscall) pushfl /* save eflags */ popl 8(%esp) /* shuffle into tf_eflags */ pushl $7 /* sizeof "lcall 7,0" */ - jmp syscall_with_err_pushed + subl $4,%esp /* skip over tf_trapno */ + pushal + pushl %ds + pushl %es + pushl %fs + mov $KDSEL,%ax /* switch to kernel segments */ + mov %ax,%ds + mov %ax,%es + mov $KPSEL,%ax + mov %ax,%fs + FAKE_MCOUNT(13*4(%esp)) + call syscall + MEXITCOUNT + jmp doreti /* * Call gate entry for FreeBSD ELF and Linux/NetBSD syscall (int 0x80) @@ -203,7 +216,6 @@ IDTVEC(lcall_syscall) SUPERALIGN_TEXT IDTVEC(int0x80_syscall) pushl $2 /* sizeof "int 0x80" */ -syscall_with_err_pushed: subl $4,%esp /* skip over tf_trapno */ pushal pushl %ds diff --git a/sys/amd64/amd64/exception.s b/sys/amd64/amd64/exception.s index 89bfb136fa5d..8eeacbc3d5b9 100644 --- a/sys/amd64/amd64/exception.s +++ b/sys/amd64/amd64/exception.s @@ -191,7 +191,20 @@ IDTVEC(lcall_syscall) pushfl /* save eflags */ popl 8(%esp) /* shuffle into tf_eflags */ pushl $7 /* sizeof "lcall 7,0" */ - jmp syscall_with_err_pushed + subl $4,%esp /* skip over tf_trapno */ + pushal + pushl %ds + pushl %es + pushl %fs + mov $KDSEL,%ax /* switch to kernel segments */ + mov %ax,%ds + mov %ax,%es + mov $KPSEL,%ax + mov %ax,%fs + FAKE_MCOUNT(13*4(%esp)) + call syscall + MEXITCOUNT + jmp doreti /* * Call gate entry for FreeBSD ELF and Linux/NetBSD syscall (int 0x80) @@ -203,7 +216,6 @@ IDTVEC(lcall_syscall) SUPERALIGN_TEXT IDTVEC(int0x80_syscall) pushl $2 /* sizeof "int 0x80" */ -syscall_with_err_pushed: subl $4,%esp /* skip over tf_trapno */ pushal pushl %ds diff --git a/sys/i386/i386/db_trace.c b/sys/i386/i386/db_trace.c index f34747cfda15..8ac4c01ab645 100644 --- a/sys/i386/i386/db_trace.c +++ b/sys/i386/i386/db_trace.c @@ -226,7 +226,9 @@ db_nextframe(fp, ip, p) } else if (!strncmp(name, "Xintr", 5) || !strncmp(name, "Xfastintr", 9)) { frame_type = INTERRUPT; - } else if (!strcmp(name, "syscall_with_err_pushed")) { + } else if (!strcmp(name, "Xlcall_syscall")) { + frame_type = SYSCALL; + } else if (!strcmp(name, "Xint0x80_syscall")) { frame_type = SYSCALL; } } diff --git a/sys/i386/i386/exception.s b/sys/i386/i386/exception.s index 89bfb136fa5d..8eeacbc3d5b9 100644 --- a/sys/i386/i386/exception.s +++ b/sys/i386/i386/exception.s @@ -191,7 +191,20 @@ IDTVEC(lcall_syscall) pushfl /* save eflags */ popl 8(%esp) /* shuffle into tf_eflags */ pushl $7 /* sizeof "lcall 7,0" */ - jmp syscall_with_err_pushed + subl $4,%esp /* skip over tf_trapno */ + pushal + pushl %ds + pushl %es + pushl %fs + mov $KDSEL,%ax /* switch to kernel segments */ + mov %ax,%ds + mov %ax,%es + mov $KPSEL,%ax + mov %ax,%fs + FAKE_MCOUNT(13*4(%esp)) + call syscall + MEXITCOUNT + jmp doreti /* * Call gate entry for FreeBSD ELF and Linux/NetBSD syscall (int 0x80) @@ -203,7 +216,6 @@ IDTVEC(lcall_syscall) SUPERALIGN_TEXT IDTVEC(int0x80_syscall) pushl $2 /* sizeof "int 0x80" */ -syscall_with_err_pushed: subl $4,%esp /* skip over tf_trapno */ pushal pushl %ds