1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-28 08:02:54 +00:00

Use FOREACH_PROC_IN_SYSTEM instead of using its unrolled form.

This commit is contained in:
Xin LI 2007-01-17 15:05:52 +00:00
parent 4f506694bb
commit f67af5c918
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=166074
6 changed files with 8 additions and 8 deletions

View File

@ -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) {

View File

@ -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);
}

View File

@ -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;

View File

@ -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;

View File

@ -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)) {

View File

@ -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;
/*