*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->NetBSD man pages -> i386_set_ioperm (2)              
Title
Content
Arch
Section
 

I386_GET_IOPERM(2)

Contents


NAME    [Toc]    [Back]

     i386_get_ioperm, i386_set_ioperm - manage i386 per-process I/O permission
     bitmap

LIBRARY    [Toc]    [Back]

     i386 Architecture Library (libi386, -li386)

SYNOPSIS    [Toc]    [Back]

     #include <sys/types.h>
     #include <machine/sysarch.h>

     int
     i386_get_ioperm(u_long *iomap);

     int
     i386_set_ioperm(u_long *iomap);

DESCRIPTION    [Toc]    [Back]

     i386_get_ioperm() copies the current I/O permission bitmap into the memory
 referenced by iomap.

     i386_set_ioperm() sets the I/O permission bitmap from the data pointed to
     by iomap.  This call is restricted to the super-user.

     The permission bitmap contains 1024 bits in 32 longwords.  If bit n is
     clear in the bitmap, then access is granted to I/O port n.  If bit n is
     set in the bitmap, then an attempt to access I/O port n results in delivery
 of a SIGBUS signal unless the process's I/O permission level would
     grant I/O access.  Bit #0 is the LSB of the first longword in the array.

RETURN VALUES    [Toc]    [Back]

     Upon successful completion, i386_get_ioperm() and i386_set_ioperm()
     return 0.  Otherwise, a value of -1 is returned and the global variable
     errno is set to indicate the error.

ERRORS    [Toc]    [Back]

     i386_get_ioperm() and i386_set_ioperm() will fail if:

     [EFAULT]  Iomap points outside the process's allocated address space.

     [EPERM]   The caller was not the super-user, or the operation was not
               permitted at the current security level.

SEE ALSO    [Toc]    [Back]

      
      
     i386_iopl(2)

REFERENCES    [Toc]    [Back]

     i386 Microprocessor Programmer's Reference Manual, Intel

WARNING    [Toc]    [Back]

     You can really hose your machine if you enable user-level I/O and write
     to hardware ports without care.

BUGS    [Toc]    [Back]

     The bitmap should really cover 65536 bits, but that's just too big for
     allocation in a kernel structure.  If you need access to ports beyond
     1024, use i386_iopl(2).

BSD                            October 14, 1995                            BSD
[ Back ]
 Similar pages
Name OS Title
amd64_get_ioperm OpenBSD manage amd64 per-process I/O permission bitmap
amd64_set_ioperm OpenBSD manage amd64 per-process I/O permission bitmap
i386_set_ioperm FreeBSD manage per-process access to the i386 I/O port space
i386_get_ioperm FreeBSD manage per-process access to the i386 I/O port space
i386_get_ldt FreeBSD manage i386 per-process Local Descriptor Table entries
i386_set_ldt FreeBSD manage i386 per-process Local Descriptor Table entries
i386_set_ldt OpenBSD manage i386 per-process Local Descriptor Table entries
i386_get_ldt NetBSD manage i386 per-process Local Descriptor Table entries
i386_get_ldt OpenBSD manage i386 per-process Local Descriptor Table entries
i386_set_ldt NetBSD manage i386 per-process Local Descriptor Table entries
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service