mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-21 12:32:56 +01:00
base-nova: Added syscall for querying the CPU vendor. This is helpful to implement CPU vendor-specific features in userspace drivers.
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#include <core_mem_alloc.h>
|
||||
#include <address_space.h>
|
||||
#include <base/allocator.h>
|
||||
#include <nova/syscall-generic.h>
|
||||
|
||||
namespace Genode {
|
||||
|
||||
@@ -51,9 +52,13 @@ namespace Genode {
|
||||
|
||||
/* map of virtual cpu ids in Genode to kernel cpu ids */
|
||||
uint8_t map_cpu_ids[MAX_SUPPORTED_CPUS];
|
||||
|
||||
/* map of virtual cpu ids in Genode to kernel NUMA ids */
|
||||
uint8_t cpu_numa_map[MAX_SUPPORTED_CPUS];
|
||||
/* map of kernel NUMA region to Genode memory ranges */
|
||||
Genode::Range_allocator::Range numa_mem_ranges[MAX_SUPPORTED_CPUS]; // TODO: Add new macro for max of numa regions
|
||||
|
||||
|
||||
addr_t _map_pages(addr_t phys_page, addr_t pages,
|
||||
bool guard_page = false);
|
||||
|
||||
@@ -164,6 +169,17 @@ namespace Genode {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return NUMA-interal vendor code for CPU
|
||||
*
|
||||
*/
|
||||
Nova::Hip::Cpu_desc::Vendor cpu_vendor() {
|
||||
extern addr_t __initial_sp;
|
||||
Nova::Hip const &hip = *(Nova::Hip *)__initial_sp;
|
||||
|
||||
return static_cast<Nova::Hip::Cpu_desc::Vendor>(hip.cpu_desc_of_cpu(0)->vendor);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user