Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

phys_to_kseg(9r) [osf1 man page]

PHYS_TO_KSEG(9r)														  PHYS_TO_KSEG(9r)

PHYS_TO_KSEG - General: Converts a physical address to a kernel-unmapped virtual address SYNOPSIS
vm_offset_t PHYS_TO_KSEG( vm_offset_t addr ); ARGUMENTS
Specifies the physical address to convert to a kernel-unmapped virtual address. DESCRIPTION
The PHYS_TO_KSEG routine converts a kernel physical address to a kernel-unmapped virtual address. EXAMPLE
The following code fragment shows a call to PHYS_TO_KSEG: . . . caddr_t virt_addr; [1] unsigned phys_addr; [2] . . . virt_addr = PHYS_TO_KSEG(phys_addr); [3] . . . Declares a variable to store the virtual address returned by PHYS_TO_KSEG. Declares a variable to store the physical address. This address might have been obtained from a call to KSEG_TO_PHYS. Calls PHYS_TO_KSEG to convert the physical address to a corresponding virtual address. RETURN VALUES
Upon successful completion, PHYS_TO_KSEG returns the virtual address associated with the specified physical address. SEE ALSO
Routines: IS_KSEG_VA(9r), KSEG_TO_PHYS(9r) PHYS_TO_KSEG(9r)

Check Out this Related Man Page

BADADDR(9r)															       BADADDR(9r)

BADADDR - General: Probes the address during device autoconfiguration SYNOPSIS
int BADADDR( caddr_t addr, int length, struct bus_ctlr_common *ptr ); ARGUMENTS
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
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
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 han- dle to a valid system physical address Call the PHYS_TO_KSEG routine to convert the valid system physical address to a kernel-unmapped vir- tual address Call the BADADDR routine, passing this kernel-unmapped virtual address as the first argument RETURN VALUES
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)
Man Page

We Also Found This Discussion For You

1. What is on Your Mind?

Throw my Toys out of the Pram!

Hi Folks, Today hasn't been the best one of my career in IT. I've been a contractor for a major utility company for a number of years, on a number of seperate IT contracts mostly Unix. The company had 10 different flavours of unix and multiple different varsions of most of them. At the... (3 Replies)
Discussion started by: gull04
3 Replies