From: Tomas Hruby Date: Tue, 15 Sep 2009 09:58:46 +0000 (+0000) Subject: iskernelp() and isuserp() test pointers X-Git-Tag: v3.1.5~145 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zpipe.c?a=commitdiff_plain;h=71077d122806f5a323de31cf1caa13cff8ff6e01;p=minix.git iskernelp() and isuserp() test pointers - we may test even not fully initialized entries, e.g. during boot crash - is we know the process number we should use iskerneln and isusern --- diff --git a/kernel/proc.h b/kernel/proc.h index 28dfb1a0e..aa3752f00 100755 --- a/kernel/proc.h +++ b/kernel/proc.h @@ -204,9 +204,9 @@ struct proc { #define isokprocn(n) ((unsigned) ((n) + NR_TASKS) < NR_PROCS + NR_TASKS) #define isemptyn(n) isemptyp(proc_addr(n)) #define isemptyp(p) ((p)->p_rts_flags == SLOT_FREE) -#define iskernelp(p) iskerneln((p)->p_nr) +#define iskernelp(p) ((p) < BEG_USER_ADDR) #define iskerneln(n) ((n) < 0) -#define isuserp(p) isusern((p)->p_nr) +#define isuserp(p) isusern((p) >= BEG_USER_ADDR) #define isusern(n) ((n) >= 0) /* The process table and pointers to process table slots. The pointers allow