summaryrefslogtreecommitdiffstats
path: root/sys/ia64
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2006-02-08 08:09:17 +0000
committerphk <phk@FreeBSD.org>2006-02-08 08:09:17 +0000
commit74f8e63a104485f17205e2a3e446e00f968c324c (patch)
treedcc7f358367ea74ccf47cede57e272875e9b589d /sys/ia64
parent4d8070a25b5c7585b416e8a3db16fc15f2e3cd13 (diff)
downloadFreeBSD-src-74f8e63a104485f17205e2a3e446e00f968c324c.zip
FreeBSD-src-74f8e63a104485f17205e2a3e446e00f968c324c.tar.gz
Simplify system time accounting for profiling.
Rename struct thread's td_sticks to td_pticks, we will need the other name for more appropriately named use shortly. Reduce it from uint64_t to u_int. Clear td_pticks whenever we enter the kernel instead of recording its value as reference for userret(). Use the absolute value of td->pticks in userret() and eliminate third argument.
Diffstat (limited to 'sys/ia64')
-rw-r--r--sys/ia64/ia32/ia32_trap.c5
-rw-r--r--sys/ia64/ia64/trap.c11
2 files changed, 6 insertions, 10 deletions
diff --git a/sys/ia64/ia32/ia32_trap.c b/sys/ia64/ia32/ia32_trap.c
index d93722e..29357f1 100644
--- a/sys/ia64/ia32/ia32_trap.c
+++ b/sys/ia64/ia32/ia32_trap.c
@@ -205,7 +205,6 @@ ia32_trap(int vector, struct trapframe *tf)
struct thread *td;
uint64_t ucode;
int sig;
- u_int sticks;
ksiginfo_t ksi;
KASSERT(TRAPF_USERMODE(tf), ("%s: In kernel mode???", __func__));
@@ -215,7 +214,7 @@ ia32_trap(int vector, struct trapframe *tf)
td = curthread;
td->td_frame = tf;
- sticks = td->td_sticks;
+ td->td_pticks = 0;
p = td->td_proc;
if (td->td_ucred != p->p_ucred)
cred_update_thread(td);
@@ -297,7 +296,7 @@ ia32_trap(int vector, struct trapframe *tf)
trapsignal(td, &ksi);
out:
- userret(td, tf, sticks);
+ userret(td, tf);
mtx_assert(&Giant, MA_NOTOWNED);
do_ast(tf);
}
diff --git a/sys/ia64/ia64/trap.c b/sys/ia64/ia64/trap.c
index 432ac69..96c03de 100644
--- a/sys/ia64/ia64/trap.c
+++ b/sys/ia64/ia64/trap.c
@@ -360,7 +360,6 @@ trap(int vector, struct trapframe *tf)
struct thread *td;
uint64_t ucode;
int error, sig, user;
- u_int sticks;
ksiginfo_t ksi;
user = TRAPF_USERMODE(tf) ? 1 : 0;
@@ -373,12 +372,11 @@ trap(int vector, struct trapframe *tf)
if (user) {
ia64_set_fpsr(IA64_FPSR_DEFAULT);
- sticks = td->td_sticks;
+ td->td_pticks = 0;
td->td_frame = tf;
if (td->td_ucred != p->p_ucred)
cred_update_thread(td);
} else {
- sticks = 0; /* XXX bogus -Wuninitialized warning */
KASSERT(cold || td->td_ucred != NULL,
("kernel trap doesn't have ucred"));
#ifdef KDB
@@ -877,7 +875,7 @@ trap(int vector, struct trapframe *tf)
out:
if (user) {
- userret(td, tf, sticks);
+ userret(td, tf);
mtx_assert(&Giant, MA_NOTOWNED);
do_ast(tf);
}
@@ -943,7 +941,6 @@ syscall(struct trapframe *tf)
struct thread *td;
uint64_t *args;
int code, error;
- u_int sticks;
ia64_set_fpsr(IA64_FPSR_DEFAULT);
@@ -956,7 +953,7 @@ syscall(struct trapframe *tf)
td->td_frame = tf;
p = td->td_proc;
- sticks = td->td_sticks;
+ td->td_pticks = 0;
if (td->td_ucred != p->p_ucred)
cred_update_thread(td);
if (p->p_flag & P_SA)
@@ -1030,7 +1027,7 @@ syscall(struct trapframe *tf)
}
}
- userret(td, tf, sticks);
+ userret(td, tf);
#ifdef KTRACE
if (KTRPOINT(td, KTR_SYSRET))
OpenPOWER on IntegriCloud