Unix and Linux Discussions Tagged with address |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
0 |
5,788 |
Cybersecurity |
|
|
|
1 |
2,494 |
UNIX for Beginners Questions & Answers |
|
|
|
7 |
9,755 |
Cybersecurity |
|
|
|
4 |
7,042 |
What is on Your Mind? |
|
|
|
8 |
2,557 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
2,905 |
Programming |
|
|
|
1 |
4,293 |
Shell Programming and Scripting |
|
|
|
8 |
5,548 |
UNIX for Dummies Questions & Answers |
|
|
|
0 |
2,112 |
OS X Support RSS |
|
|
|
0 |
2,270 |
UNIX and Linux Applications |
|
|
|
4 |
11,844 |
UNIX and Linux Applications |
|
|
|
1 |
7,281 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
9,301 |
IP Networking |
|
|
|
3 |
34,273 |
OS X (Apple) |
|
|
|
3 |
9,220 |
UNIX for Advanced & Expert Users |
|
|
|
2 |
3,103 |
IP Networking |
|
|
|
6 |
13,226 |
Solaris |
|
|
|
0 |
3,970 |
Programming |
|
|
|
1 |
4,227 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
5,338 |
Post Here to Contact Site Administrators and Moderators |
|
|
|
5 |
20,065 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
9,232 |
Programming |
|
|
|
3 |
5,019 |
IP Networking |
|
|
|
4 |
7,653 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
13,412 |
IP Networking |
|
|
|
2 |
9,282 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
222,434 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
9,436 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
10,515 |
UNIX for Advanced & Expert Users |
|
|
|
7 |
10,060 |
UNIX for Advanced & Expert Users |
|
|
|
7 |
176,392 |
UNIX for Dummies Questions & Answers |
|
|
|
8 |
30,971 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
3,722 |
UNIX for Advanced & Expert Users |
|
|
|
1 |
5,927 |
IP Networking |
|
|
|
1 |
5,028 |
IP Networking |
|
|
|
5 |
5,500 |
IP Networking |
|
|
|
2 |
2,998 |
UNIX for Dummies Questions & Answers |
|
|
|
10 |
11,589 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
3,897 |
Post Here to Contact Site Administrators and Moderators |
|
|
|
4 |
6,728 |
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)