Use NULL instead of 0 in a few places as well as various whitespace fixes.
This commit is contained in:
parent
9e6c867ccc
commit
753d1af165
@ -416,7 +416,7 @@ i386_set_ldt(td, args)
|
||||
int error = 0, i;
|
||||
int largest_ld;
|
||||
struct mdproc *mdp = &td->td_proc->p_md;
|
||||
struct proc_ldt *pldt = 0;
|
||||
struct proc_ldt *pldt = NULL;
|
||||
struct i386_ldt_args ua, *uap = &ua;
|
||||
union descriptor *descs, *dp;
|
||||
int descs_size;
|
||||
@ -435,7 +435,7 @@ i386_set_ldt(td, args)
|
||||
/*
|
||||
* Treat this as a special case, so userland needn't
|
||||
* know magic number NLDT.
|
||||
*/
|
||||
*/
|
||||
uap->start = NLDT;
|
||||
uap->num = MAX_LD - NLDT;
|
||||
}
|
||||
@ -555,7 +555,7 @@ i386_set_ldt(td, args)
|
||||
/* Allocate a free slot */
|
||||
pldt = mdp->md_ldt;
|
||||
if (pldt == NULL) {
|
||||
error = i386_ldt_grow(td, NLDT+1);
|
||||
error = i386_ldt_grow(td, NLDT + 1);
|
||||
if (error) {
|
||||
kmem_free(kernel_map, (vm_offset_t)descs,
|
||||
descs_size);
|
||||
@ -630,8 +630,8 @@ i386_ldt_grow(struct thread *td, int len)
|
||||
|
||||
if (len > MAX_LD)
|
||||
return (ENOMEM);
|
||||
if (len < NLDT+1)
|
||||
len = NLDT+1;
|
||||
if (len < NLDT + 1)
|
||||
len = NLDT + 1;
|
||||
pldt = mdp->md_ldt;
|
||||
/* allocate user ldt */
|
||||
if (!pldt || len > pldt->ldt_len) {
|
||||
|
@ -242,9 +242,9 @@ cpu_fork(td1, p2, td2, flags)
|
||||
*/
|
||||
pcb2->pcb_ext = 0;
|
||||
|
||||
/* Copy the LDT, if necessary. */
|
||||
/* Copy the LDT, if necessary. */
|
||||
mtx_lock_spin(&sched_lock);
|
||||
if (mdp2->md_ldt != 0) {
|
||||
if (mdp2->md_ldt != NULL) {
|
||||
if (flags & RFMEM) {
|
||||
mdp2->md_ldt->ldt_refcnt++;
|
||||
} else {
|
||||
@ -253,7 +253,7 @@ cpu_fork(td1, p2, td2, flags)
|
||||
if (mdp2->md_ldt == NULL)
|
||||
panic("could not copy LDT");
|
||||
}
|
||||
}
|
||||
}
|
||||
mtx_unlock_spin(&sched_lock);
|
||||
|
||||
/*
|
||||
@ -316,11 +316,11 @@ cpu_thread_exit(struct thread *td)
|
||||
if (td == PCPU_GET(fpcurthread))
|
||||
npxdrop();
|
||||
#endif
|
||||
if (pcb->pcb_flags & PCB_DBREGS) {
|
||||
if (pcb->pcb_flags & PCB_DBREGS) {
|
||||
/* disable all hardware breakpoints */
|
||||
reset_dbregs();
|
||||
pcb->pcb_flags &= ~PCB_DBREGS;
|
||||
}
|
||||
reset_dbregs();
|
||||
pcb->pcb_flags &= ~PCB_DBREGS;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
x
Reference in New Issue
Block a user