Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Aug 2005 15:50:55 -0400
From:      John Baldwin <jhb@FreeBSD.org>
To:        freebsd-hackers@freebsd.org
Subject:   Re: Using sysarch specific syscalls in assembly?
Message-ID:  <200508081550.56292.jhb@FreeBSD.org>
In-Reply-To: <20050808191910.GA91484@skatecity>
References:  <20050808191910.GA91484@skatecity>

next in thread | previous in thread | raw e-mail | index | archive | help
On Monday 08 August 2005 03:19 pm, alexander wrote:
> Hi there.
>
> I wrote a program that needs to access I/O ports with the in/out
> machinecodes. To gain priviliges to do so I have opened /dev/io. Now
> somebody told me that I'd rather use i386_set_ioperm which will be much
> saver, because of the port range limitation. Plus it will make the program
> more portable because Linux does not have a /dev/io device node.
>
> i386_set_ioperm(2) states that this procedure is a system call. So it
> should be easily accessable through assembly language and it's specific
> syscall id. Unfortunately I wasn't able to find the syscall id in any of
> the
> syscalls.master files that are part of the source tree.
>
> <machine/sysarch.h> states that this is a sysarch specific syscall for i386
> (hence the i386_*). The following definitions are being made:
>
> #define I386_GET_IOPERM 3
> #define I386_SET_IOPERM 4
>
> These syscall numbers however are already taken by read(2) and write(2). So
> how can I make use of these i386 specific syscalls? Is it even possible?
>
> Thx in advance.

You have to call the sysarch() system call.  The first argument to it would be 
the operation (I386_GET_IOPERM, etc.).

-- 
John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200508081550.56292.jhb>