diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/syscall_misc.C | 22 | ||||
-rw-r--r-- | src/lib/syscall_msg.C | 25 | ||||
-rw-r--r-- | src/lib/syscall_task.C | 3 |
3 files changed, 45 insertions, 5 deletions
diff --git a/src/lib/syscall_misc.C b/src/lib/syscall_misc.C index 26ecc9bfe..ac9070a40 100644 --- a/src/lib/syscall_misc.C +++ b/src/lib/syscall_misc.C @@ -43,3 +43,25 @@ uint8_t cpu_dd_level() return reinterpret_cast<uint64_t>(_syscall0(MISC_CPUDDLEVEL)); } +size_t cpu_thread_count() +{ + size_t threads = 0; + ProcessorCoreType core_type = cpu_core_type(); + switch(core_type) + { + case CORE_POWER7: + case CORE_POWER7_PLUS: + threads = 4; + break; + + case CORE_POWER8_SALERNO: + case CORE_POWER8_VENICE: + threads = 8; + break; + + default: + break; + } + return threads; +} + diff --git a/src/lib/syscall_msg.C b/src/lib/syscall_msg.C index 08fafcbef..1b0ea500a 100644 --- a/src/lib/syscall_msg.C +++ b/src/lib/syscall_msg.C @@ -21,6 +21,7 @@ // // IBM_PROLOG_END #include <sys/msg.h> +#include <sys/interrupt.h> #include <sys/syscall.h> #include <sys/vfs.h> @@ -42,11 +43,20 @@ int msg_q_register(msg_q_t q, const char* name) { if (0 == strcmp(VFS_ROOT, name)) { - return (int64_t)_syscall1(MSGQ_REGISTER_ROOT, q); + return (int64_t)_syscall2(MSGQ_REGISTER_ROOT, + reinterpret_cast<void*>(MSGQ_ROOT_VFS), + q); + } + else if (0 == strcmp(INTR_MSGQ, name)) + { + return (int64_t)_syscall2(MSGQ_REGISTER_ROOT, + reinterpret_cast<void*>(MSGQ_ROOT_INTR), + q); } else { - msg_q_t vfsQ = (msg_q_t)_syscall0(MSGQ_RESOLVE_ROOT); + msg_q_t vfsQ = (msg_q_t)_syscall1(MSGQ_RESOLVE_ROOT, + reinterpret_cast<void*>(MSGQ_ROOT_VFS)); msg_t* msg = msg_allocate(); msg->type = VFS_MSG_REGISTER_MSGQ; msg->data[0] = (uint64_t) q; @@ -61,11 +71,18 @@ msg_q_t msg_q_resolve(const char* name) { if (0 == strcmp(VFS_ROOT, name)) { - return (msg_q_t)_syscall0(MSGQ_RESOLVE_ROOT); + return (msg_q_t)_syscall1(MSGQ_RESOLVE_ROOT, + reinterpret_cast<void*>(MSGQ_ROOT_VFS)); + } + else if (0 == strcmp(INTR_MSGQ, name)) + { + return (msg_q_t)_syscall1(MSGQ_RESOLVE_ROOT, + reinterpret_cast<void*>(MSGQ_ROOT_INTR)); } else { - msg_q_t vfsQ = (msg_q_t)_syscall0(MSGQ_RESOLVE_ROOT); + msg_q_t vfsQ = (msg_q_t)_syscall1(MSGQ_RESOLVE_ROOT, + reinterpret_cast<void*>(MSGQ_ROOT_VFS)); msg_t* msg = msg_allocate(); msg->type = VFS_MSG_RESOLVE_MSGQ; msg->extra_data = (void*) name; diff --git a/src/lib/syscall_task.C b/src/lib/syscall_task.C index a00b779f7..d40136a21 100644 --- a/src/lib/syscall_task.C +++ b/src/lib/syscall_task.C @@ -80,7 +80,8 @@ tid_t task_exec(const char* file, void* ptr) int rc = 0; // Create message, send. - msg_q_t vfsQ = (msg_q_t)_syscall0(MSGQ_RESOLVE_ROOT); + msg_q_t vfsQ = (msg_q_t)_syscall1(MSGQ_RESOLVE_ROOT, + reinterpret_cast<void*>(MSGQ_ROOT_VFS)); msg_t* msg = msg_allocate(); msg->type = VFS_MSG_EXEC; msg->data[0] = (uint64_t) file; |