Use FOREACH_PROC_IN_SYSTEM instead of using its unrolled form.
This commit is contained in:
parent
4f506694bb
commit
f67af5c918
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=166074
@ -579,7 +579,7 @@ db_kill(dummy1, dummy2, dummy3, dummy4)
|
||||
* since we're in DDB.
|
||||
*/
|
||||
/* sx_slock(&allproc_lock); */
|
||||
LIST_FOREACH(p, &allproc, p_list)
|
||||
FOREACH_PROC_IN_SYSTEM(p)
|
||||
if (p->p_pid == pid)
|
||||
break;
|
||||
/* sx_sunlock(&allproc_lock); */
|
||||
@ -693,7 +693,7 @@ db_stack_trace_all(db_expr_t dummy, boolean_t dummy2, db_expr_t dummy3,
|
||||
jmp_buf jb;
|
||||
void *prev_jb;
|
||||
|
||||
LIST_FOREACH(p, &allproc, p_list) {
|
||||
FOREACH_PROC_IN_SYSTEM(p) {
|
||||
prev_jb = kdb_jmpbuf(jb);
|
||||
if (setjmp(jb) == 0) {
|
||||
FOREACH_THREAD_IN_PROC(p, td) {
|
||||
|
@ -159,7 +159,7 @@ db_lookup_thread(db_expr_t addr, boolean_t check_pid)
|
||||
if (td != NULL)
|
||||
return (td);
|
||||
if (check_pid) {
|
||||
LIST_FOREACH(p, &allproc, p_list) {
|
||||
FOREACH_PROC_IN_SYSTEM(p) {
|
||||
if (p->p_pid == decaddr)
|
||||
return (FIRST_THREAD_IN_PROC(p));
|
||||
}
|
||||
@ -185,7 +185,7 @@ db_lookup_proc(db_expr_t addr)
|
||||
|
||||
decaddr = hex2dec(addr);
|
||||
if (decaddr != -1) {
|
||||
LIST_FOREACH(p, &allproc, p_list) {
|
||||
FOREACH_PROC_IN_SYSTEM(p) {
|
||||
if (p->p_pid == decaddr)
|
||||
return (p);
|
||||
}
|
||||
|
@ -3544,7 +3544,7 @@ pmap_pid_dump(int pid)
|
||||
int index;
|
||||
|
||||
sx_slock(&allproc_lock);
|
||||
LIST_FOREACH(p, &allproc, p_list) {
|
||||
FOREACH_PROC_IN_SYSTEM(p) {
|
||||
if (p->p_pid != pid)
|
||||
continue;
|
||||
|
||||
|
@ -110,7 +110,7 @@ ibcs2_modevent(module_t mod, int type, void *unused)
|
||||
case MOD_UNLOAD:
|
||||
/* if this was an ELF module we'd use elf_brand_inuse()... */
|
||||
sx_slock(&allproc_lock);
|
||||
LIST_FOREACH(p, &allproc, p_list) {
|
||||
FOREACH_PROC_IN_SYSTEM(p) {
|
||||
if (p->p_sysent == &ibcs2_svr3_sysvec) {
|
||||
rval = EBUSY;
|
||||
break;
|
||||
|
@ -1995,7 +1995,7 @@ vm_object_in_map(vm_object_t object)
|
||||
struct proc *p;
|
||||
|
||||
/* sx_slock(&allproc_lock); */
|
||||
LIST_FOREACH(p, &allproc, p_list) {
|
||||
FOREACH_PROC_IN_SYSTEM(p) {
|
||||
if (!p->p_vmspace /* || (p->p_flag & (P_SYSTEM|P_WEXIT)) */)
|
||||
continue;
|
||||
if (_vm_object_in_map(&p->p_vmspace->vm_map, object, 0)) {
|
||||
|
@ -1574,7 +1574,7 @@ vm_daemon()
|
||||
* process is swapped out -- deactivate pages
|
||||
*/
|
||||
sx_slock(&allproc_lock);
|
||||
LIST_FOREACH(p, &allproc, p_list) {
|
||||
FOREACH_PROC_IN_SYSTEM(p) {
|
||||
vm_pindex_t limit, size;
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user