Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 08 Aug 2005 20:20:38 +0000
From:      "ari edelkind" <edelkind-freebsd-hackers@episec.com>
To:        freebsd-hackers@freebsd.org
Subject:   Re: Using sysarch specific syscalls in assembly?
Message-ID:  <20050808202039.C988B43D48@mx1.FreeBSD.org>
In-Reply-To: <20050808191910.GA91484@skatecity>

next in thread | previous in thread | raw e-mail | index | archive | help
On 8/8/2005, "alexander" <arundel@h3c.de> wrote:

[...]
>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?

If you're unsure of how a function is called, you can always check the C
library, under 'src/lib/libc/'.  I won't repeat john baldwin's
answer, but it's exactly what you'd find there.

That said, C library calls are no more difficult to perform from assembly
language than system calls, so long as you're willing to link in the
standard C library.  If you're trying to be more portable, then unless
you have specific reasons for not doing so, perhaps it's something
you'd like to consider.

ari



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