2014-04-28 21:31:57 +02:00
|
|
|
/*
|
|
|
|
* \brief Core-local mapping
|
|
|
|
* \author Stefan Kalkowski
|
|
|
|
* \date 2014-02-26
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2017-02-20 13:23:52 +01:00
|
|
|
* Copyright (C) 2014-2017 Genode Labs GmbH
|
2014-04-28 21:31:57 +02:00
|
|
|
*
|
|
|
|
* This file is part of the Genode OS framework, which is distributed
|
2017-02-20 13:23:52 +01:00
|
|
|
* under the terms of the GNU Affero General Public License version 3.
|
2014-04-28 21:31:57 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _CORE__INCLUDE__MAP_LOCAL_H_
|
|
|
|
#define _CORE__INCLUDE__MAP_LOCAL_H_
|
|
|
|
|
2017-02-21 13:46:59 +01:00
|
|
|
#include <hw/page_flags.h>
|
2014-07-08 15:46:53 +02:00
|
|
|
|
2014-04-28 21:31:57 +02:00
|
|
|
namespace Genode {
|
|
|
|
|
2017-02-21 13:46:59 +01:00
|
|
|
using Hw::Page_flags;
|
|
|
|
|
2014-04-28 21:31:57 +02:00
|
|
|
/**
|
|
|
|
* Map physical pages to core-local virtual address range
|
|
|
|
*
|
|
|
|
* \param from_phys physical source address
|
|
|
|
* \param to_virt core-local destination address
|
|
|
|
* \param num_pages number of pages to map
|
|
|
|
* \param io_mem true if it's memory mapped I/O (uncached)
|
|
|
|
*
|
|
|
|
* \return true on success
|
|
|
|
*/
|
|
|
|
bool map_local(addr_t from_phys, addr_t to_virt, size_t num_pages,
|
2017-02-21 13:46:59 +01:00
|
|
|
Page_flags flags = Hw::PAGE_FLAGS_KERN_DATA);
|
2014-04-28 21:31:57 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Unmap pages from core's address space
|
|
|
|
*
|
|
|
|
* \param virt_addr first core-local address to unmap, must be page-aligned
|
|
|
|
* \param num_pages number of pages to unmap
|
|
|
|
*
|
|
|
|
* \return true on success
|
|
|
|
*/
|
|
|
|
bool unmap_local(addr_t virt_addr, size_t num_pages);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* _CORE__INCLUDE__MAP_LOCAL_H_ */
|