Subj : suspend a kernel thread in AIX and get register contents To : comp.unix.aix,comp.programming.threads From : kamalp Date : Wed Mar 23 2005 06:45 am Hello, I am using AIX 5.3. The /proc filesystem contains an lwpstatus -which holds the registers of the currently executing thread. Unfortunately, the registers can only be accessed when the thread is suspended. So the problem is like this:- user_process -> syscall ->kernel extension code ->get_registers() I want to spawn a new kernel thread and block for this thread, while the other thread gets the registers for this thread. But I am running into a problem. int my_func(void* data) { open /proc/lwp//lwpstatus & read register contents. e_wakeup_thread(&event); e_clear_wait(, THREAD_TIMED_OUT); /* just in case it wasn't awakened */ } my_kern_code () { int *event; tid = thread_create(); kthread_start(tid, my_func, (void*)(event+thread_self), datasize, NULL, NULL); e_sleep_thread(&event, NULL, NULL); } ---------------------- This code doesn't seem to work. It actually hangs the whole kernel as if it got stuck in a deadlock. Also, one piece of aix documentation says thread_create can be used in process context. Another says it has to be used in kernel process only and not in an extension. Why this contradiction/restriction? Further, is there any syscall that can be called from kernel extension to get register contents? Why wouldn't ptracex() or its equivalent code be made available to kernel extensions? thanks -kamal .