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

  man pages->Tru64 Unix man pages -> BADADDR (9r)              
Title
Content
Arch
Section
 

BADADDR(9r)

Contents


NAME    [Toc]    [Back]

       BADADDR  - General: Probes the address during device autoconfiguration

SYNOPSIS    [Toc]    [Back]

       int BADADDR(
               caddr_t addr,
               int length,
               struct bus_ctlr_common *ptr );

ARGUMENTS    [Toc]    [Back]

       Specifies the address of the device registers  or  memory.
       Specifies the length (in bytes) of the data to be checked.
       Valid values are 1, 2, and 4 on 32-bit machines and 4  and
       8   on   64-bit   machines.   Specifies  a  pointer  to  a
       bus_ctlr_common structure. You cast  this  argument  as  a
       pointer to either a bus or controller structure.

DESCRIPTION    [Toc]    [Back]

       The  BADADDR  routine generates a call to a machine-dependent
 routine that does a read access check of the data  at
       the  supplied  address  and  dismisses  any  machine check
       exception that may result from the attempted  access.  You
       call  this routine to probe for memory or I/O devices at a
       specified address during device autoconfiguration.

NOTES    [Toc]    [Back]

       You can use BADADDR in device drivers that are  statically
       configured  into  the  kernel.  However,  you  cannot  use
       BADADDR if the driver is dynamically configured  into  the
       kernel.

       If  you  implement  the  driver  to be both statically and
       dynamically configured, you can declare a variable and use
       it to control the call to BADADDR.

       The  following code fragment shows the use of such a variable
 used in the probe routine for the /dev/none driver:

       .  .  .

            if (none_is_dynamic) {

            /* Code to handle tasks associated with a dynamically
       *
             * configured driver */

       .  .  .

            }
            else {

           /*  Code  to  handle  tasks  (including  the  call  to
       BADADDR) *
            * associated with a statically configured driver *
            * including call to BADADDR            */
           }

       .  .  .


       The EISA and ISA buses do not  generate  a  machine  check
       when BADADDR performs a read access to a nonexistent location.
 These buses always return success when BADADDR  performs
 a read access to their address space.

       For  the PCI bus and the VMEbus, you must do the following
       before calling BADADDR: Call the iohandle_to_phys  routine
       to  convert  the  I/O  handle  to  a valid system physical
       address Call the PHYS_TO_KSEG routine to convert the valid
       system  physical  address  to  a  kernel-unmapped  virtual
       address Call the BADADDR  routine,  passing  this  kernelunmapped
 virtual address as the first argument

RETURN VALUES    [Toc]    [Back]

       The BADADDR routine returns the value 0 (zero) if the data
       is accessible or a nonzero value if the data is not accessible.




                                                      BADADDR(9r)
[ Back ]
 Similar pages
Name OS Title
KSEG_TO_PHYS Tru64 General: Converts a kernel-unmapped virtual address to a physical address
svatophys Tru64 General: Converts a system virtual address to a physical address
copy_to_phys Tru64 General: Copies data from a virtual address to a physical address
vtop Tru64 General: Converts any virtual address to a physical address
config NetBSD the autoconfiguration framework ``device definition'' language
copyinstr Tru64 General: Copies a null-terminated string from a user address space to a kernel address space
copyoutstr Tru64 General: Copies a null-terminated string from a kernel address space to a user address space
copyout Tru64 General: Copies data from a kernel address space to a user address space
copyin Tru64 General: Copies data from a user address space to a kernel address space
probenis Tru64 Probes for existence of NIS server
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service