Subversion Repositories HelenOS

Rev

Rev 2361 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2361 Rev 2362
Line 82... Line 82...
82
 * Map device into kernel space.
82
 * Map device into kernel space.
83
 *
83
 *
84
 * This function adds mapping of physical address that is read/write only
84
 * This function adds mapping of physical address that is read/write only
85
 *  from kernel and not bufferable.
85
 *  from kernel and not bufferable.
86
 *
86
 *
87
 * \param physaddr Physical addres where device is connected
87
 * @param physaddr Physical addres where device is connected
88
 * \param size Length of area where device is present
88
 * @param size Length of area where device is present
89
 * \return Virtual address where device will be accessable
89
 * @return Virtual address where device will be accessable
90
 */
90
 */
91
uintptr_t hw_map(uintptr_t physaddr, size_t size)
91
uintptr_t hw_map(uintptr_t physaddr, size_t size)
92
{
92
{
93
    if (last_frame + ALIGN_UP(size, PAGE_SIZE) > KA2PA(KERNEL_ADDRESS_SPACE_END_ARCH)) {
93
    if (last_frame + ALIGN_UP(size, PAGE_SIZE) > KA2PA(KERNEL_ADDRESS_SPACE_END_ARCH)) {
94
        panic("Unable to map physical memory %p (%d bytes)", physaddr, size)
94
        panic("Unable to map physical memory %p (%d bytes)", physaddr, size)