8203227: Introduce os::processor_id() for Linux and Solaris

Reviewed-by: dholmes, rehn
This commit is contained in:
Per Lidén 2018-05-18 15:21:23 +02:00
parent ab469d40fc
commit dface12e6d
3 changed files with 20 additions and 0 deletions

View file

@ -291,6 +291,12 @@ void os::Solaris::initialize_system_info() {
(julong)sysconf(_SC_PAGESIZE);
}
uint os::processor_id() {
const processorid_t id = ::getcpuid();
assert(id >= 0 && id < _processor_count, "Invalid processor id");
return (uint)id;
}
int os::active_processor_count() {
// User has overridden the number of active processors
if (ActiveProcessorCount > 0) {