From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 8 19:50:38 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 01FA816A41F for ; Mon, 8 Aug 2005 19:50:38 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: from mv.twc.weather.com (mv.twc.weather.com [65.212.71.225]) by mx1.FreeBSD.org (Postfix) with ESMTP id 96A4343D49 for ; Mon, 8 Aug 2005 19:50:37 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: from [10.50.40.201] (Not Verified[65.202.103.25]) by mv.twc.weather.com with NetIQ MailMarshal (v6, 0, 3, 8) id ; Mon, 08 Aug 2005 16:05:22 -0400 From: John Baldwin To: freebsd-hackers@freebsd.org Date: Mon, 8 Aug 2005 15:50:55 -0400 User-Agent: KMail/1.8 References: <20050808191910.GA91484@skatecity> In-Reply-To: <20050808191910.GA91484@skatecity> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200508081550.56292.jhb@FreeBSD.org> Cc: Subject: Re: Using sysarch specific syscalls in assembly? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Aug 2005 19:50:38 -0000 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. > > 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 <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org