# Get thread struct



## rft (Jun 6, 2010)

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

i386 snippet:


```
#define PORT 0x378
i386_set_ioperm(PORT, 1, 1)
```

amd64 snippet:


```
#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


----------



## expl (Jun 7, 2010)

"amd64_set_ioperm" is a kernel function and its kthread that it is asking. You should use on amd64: 
	
	



```
sysarch(I386_SET_IOPERM, (void *)enable_port);
```


----------

