Unix and Linux Discussions Tagged with ip address |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
0 |
5,856 |
Cybersecurity |
|
|
|
6 |
8,677 |
Shell Programming and Scripting |
|
|
|
7 |
9,834 |
Cybersecurity |
|
|
|
2 |
2,630 |
UNIX for Beginners Questions & Answers |
|
|
|
16 |
5,955 |
What is on Your Mind? |
|
|
|
5 |
7,364 |
UNIX for Advanced & Expert Users |
|
|
|
4 |
3,175 |
Shell Programming and Scripting |
|
|
|
4 |
4,527 |
Shell Programming and Scripting |
|
|
|
2 |
1,803 |
IP Networking |
|
|
|
10 |
7,789 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
11,089 |
IP Networking |
|
|
|
0 |
2,972 |
UNIX for Advanced & Expert Users |
|
|
|
29 |
22,492 |
Solaris |
|
|
|
2 |
3,872 |
Shell Programming and Scripting |
|
|
|
6 |
25,352 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
15,825 |
UNIX for Advanced & Expert Users |
|
|
|
1 |
7,314 |
Solaris |
|
|
|
1 |
10,949 |
Shell Programming and Scripting |
|
|
|
0 |
4,521 |
UNIX and Linux Applications |
|
|
|
3 |
10,106 |
Shell Programming and Scripting |
|
|
|
2 |
4,756 |
Linux |
|
|
|
4 |
3,569 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
9,924 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
6,337 |
Linux |
|
|
|
3 |
21,871 |
IP Networking |
|
|
|
6 |
50,962 |
Solaris |
|
|
|
2 |
4,363 |
UNIX for Dummies Questions & Answers |
|
|
|
7 |
22,263 |
OS X (Apple) |
|
|
|
5 |
5,575 |
UNIX for Dummies Questions & Answers |
|
|
|
6 |
10,848 |
AIX |
|
|
|
9 |
20,225 |
UNIX for Dummies Questions & Answers |
|
|
|
15 |
43,140 |
IP Networking |
|
|
|
2 |
2,414 |
Shell Programming and Scripting |
|
|
|
4 |
11,866 |
UNIX and Linux Applications |
|
|
|
2 |
14,298 |
Shell Programming and Scripting |
|
|
|
3 |
3,965 |
Shell Programming and Scripting |
|
|
|
7 |
10,284 |
Solaris |
|
|
|
9 |
7,015 |
Solaris |
|
|
|
3 |
5,934 |
Shell Programming and Scripting |
|
|
|
2 |
6,509 |
IP Networking |
KSEG_TO_PHYS(9r) KSEG_TO_PHYS(9r)
NAME
KSEG_TO_PHYS - General: Converts a kernel-unmapped virtual address to a physical address
SYNOPSIS
vm_offset_t KSEG_TO_PHYS(
vm_offset_t addr );
ARGUMENTS
Specifies the buffer virtual address to convert to a physical address.
DESCRIPTION
The KSEG_TO_PHYS routine converts a kernel-unmapped virtual address to a kernel physical address. Device drivers can use this physical
address in DMA operations. Prior to calling KSEG_TO_PHYS, device driver writers often call one of the following routines to determine
whether the address passed is a virtual address in the addressed kernel segment: IS_KSEG_VA
Determines if the specified address is located in the kernel-unmapped address space. IS_SEG0_VA
Determines if the specified address is located in the user-mapped address space. IS_SEG1_VA
Determines if the specified address is located in the kernel-mapped address space.
RETURN VALUES
Upon successful completion, KSEG_TO_PHYS returns the physical address.
EXAMPLE
The following code fragment shows a call to KSEG_TO_PHYS:
. . .
caddr_t virt_addr; [1] unsigned phys_addr; [2]
. . .
if(IS_KSEG_VA(virt_addr)) { [3]
phys_addr = KSEG_TO_PHYS(virt_addr); [4]
. . .
Declares a variable to store the user buffer's virtual address. Declares a variable to store the physical address returned by
KSEG_TO_PHYS. Before calling KSEG_TO_PHYS, calls IS_KSEG_VA to determine if the virtual address is from the kernel-unmapped address space.
If the virtual address is from the kernel-unmapped address space, then calls KSEG_TO_PHYS to convert the address to a corresponding physi-
cal address.
SEE ALSO
Routines: IS_KSEG_VA(9r), PHYS_TO_KSEG(9r)
KSEG_TO_PHYS(9r)