Get thread struct

I'm trying to port i386 C program which uses LPT port to amd64.

i386 snippet:

Code:
#define PORT 0x378
i386_set_ioperm(PORT, 1, 1)

amd64 snippet:

Code:
#define PORT 0x378
struct i386_ioperm_args enable_port = { PORT, 1, 1 };
amd64_set_ioperm(thread, enable_port)

I can not figure out how to get struct which represents current thread
(actually, it is single thread application)
to pass into the amd64_set_ioperm function.

Thanks for advise
 
"amd64_set_ioperm" is a kernel function and its kthread that it is asking. You should use on amd64:
Code:
sysarch(I386_SET_IOPERM, (void *)enable_port);
 
  • Thanks
Reactions: rft
Back
Top