aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64/linux32/linux32_sysvec.c
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2010-12-22 00:18:42 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2010-12-22 00:18:42 +0000
commite6c006d96a5847bb9462b8eadba9315828deb3d7 (patch)
tree38bd55300c4f19ade4f88947688e903fcf6ef97c /sys/amd64/linux32/linux32_sysvec.c
parent6e4e1c18e48602658a6472a40b9be7a818b05888 (diff)
downloadsrc-e6c006d96a5847bb9462b8eadba9315828deb3d7.tar.gz
src-e6c006d96a5847bb9462b8eadba9315828deb3d7.zip
Improve PCB flags handling and make it more robust. Add two new functions
for manipulating pcb_flags. These inline functions are very similar to atomic_set_char(9) and atomic_clear_char(9) but without unnecessary LOCK prefix for SMP. Add comments about the rationale[1]. Use these functions wherever possible. Although there are some places where it is not strictly necessary (e.g., a PCB is copied to create a new PCB), it is done across the board for sake of consistency. Turn pcb_full_iret into a PCB flag as it is safe now. Move rarely used fields before pcb_flags and reduce size of pcb_flags to one byte. Fix some style(9) nits in pcb.h while I am in the neighborhood. Reviewed by: kib Submitted by: kib[1] MFC after: 2 months
Notes
Notes: svn path=/head/; revision=216634
Diffstat (limited to 'sys/amd64/linux32/linux32_sysvec.c')
-rw-r--r--sys/amd64/linux32/linux32_sysvec.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c
index 3ebb980f26f3..674a286e1e33 100644
--- a/sys/amd64/linux32/linux32_sysvec.c
+++ b/sys/amd64/linux32/linux32_sysvec.c
@@ -422,7 +422,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
regs->tf_fs = _ufssel;
regs->tf_gs = _ugssel;
regs->tf_flags = TF_HASSEGS;
- td->td_pcb->pcb_full_iret = 1;
+ set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
PROC_LOCK(p);
mtx_lock(&psp->ps_mtx);
}
@@ -545,7 +545,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
regs->tf_fs = _ufssel;
regs->tf_gs = _ugssel;
regs->tf_flags = TF_HASSEGS;
- td->td_pcb->pcb_full_iret = 1;
+ set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
PROC_LOCK(p);
mtx_lock(&psp->ps_mtx);
}
@@ -643,7 +643,7 @@ linux_sigreturn(struct thread *td, struct linux_sigreturn_args *args)
regs->tf_rflags = eflags;
regs->tf_rsp = frame.sf_sc.sc_esp_at_signal;
regs->tf_ss = frame.sf_sc.sc_ss;
- td->td_pcb->pcb_full_iret = 1;
+ set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
return (EJUSTRETURN);
}
@@ -742,7 +742,7 @@ linux_rt_sigreturn(struct thread *td, struct linux_rt_sigreturn_args *args)
regs->tf_rflags = eflags;
regs->tf_rsp = context->sc_esp_at_signal;
regs->tf_ss = context->sc_ss;
- td->td_pcb->pcb_full_iret = 1;
+ set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
/*
* call sigaltstack & ignore results..
@@ -869,9 +869,8 @@ exec_linux_setregs(struct thread *td, struct image_params *imgp, u_long stack)
fpstate_drop(td);
/* Do full restore on return so that we can change to a different %cs */
- pcb->pcb_flags |= PCB_32BIT;
- pcb->pcb_flags &= ~PCB_GS32BIT;
- pcb->pcb_full_iret = 1;
+ set_pcb_flags(pcb, PCB_32BIT | PCB_FULL_IRET);
+ clear_pcb_flags(pcb, PCB_GS32BIT);
td->td_retval[1] = 0;
}