thread2-r0drv-haiku.c revision 2b3dc93fedb4e72ac5b3cbaa89a9fc2f559be550
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync * IPRT - Threads (Part 2), Ring-0 Driver, Haiku.
34ee2570b5979d1e4ac39b4da8e453a9c99600a6vboxsync * Copyright (C) 2012 Oracle Corporation
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync * available from http://www.virtualbox.org. This file is free software;
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync * you can redistribute it and/or modify it under the terms of the GNU
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync * General Public License (GPL) as published by the Free Software
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync * The contents of this file may alternatively be used under the terms
b0ad0bbadf3a5b5258acda1bfe16f0ad8bee5ff0vboxsync * of the Common Development and Distribution License Version 1.0
b0ad0bbadf3a5b5258acda1bfe16f0ad8bee5ff0vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
b0ad0bbadf3a5b5258acda1bfe16f0ad8bee5ff0vboxsync * VirtualBox OSE distribution, in which case the provisions of the
b0ad0bbadf3a5b5258acda1bfe16f0ad8bee5ff0vboxsync * CDDL are applicable instead of those of the GPL.
b0ad0bbadf3a5b5258acda1bfe16f0ad8bee5ff0vboxsync * You may elect to license modified versions of this file under the
1ce069685b24d243eb0464f46d4c56b250c64445vboxsync * terms and conditions of either the GPL or the CDDL or both.
a55af63ead2dcca370bfc0dfe49771d9dcc61b93vboxsync/*******************************************************************************
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync* Header Files *
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync*******************************************************************************/
b0ad0bbadf3a5b5258acda1bfe16f0ad8bee5ff0vboxsync /* No TLS in Ring-0. :-/ */
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync return rtThreadGetByNative((RTNATIVETHREAD)find_thread(NULL));
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsyncint rtThreadNativeSetPriority(PRTTHREADINT pThread, RTTHREADTYPE enmType)
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync * Convert the priority type to native priorities.
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync * (This is quite naive but should be ok.)
a0644dbbd30adb9bd2937110d6f016e56c4cc52bvboxsync case RTTHREADTYPE_INFREQUENT_POLLER: iPriority = B_LOWEST_ACTIVE_PRIORITY; break;
a0644dbbd30adb9bd2937110d6f016e56c4cc52bvboxsync case RTTHREADTYPE_EMULATION: iPriority = B_LOW_PRIORITY; break;
a0644dbbd30adb9bd2937110d6f016e56c4cc52bvboxsync case RTTHREADTYPE_DEFAULT: iPriority = B_NORMAL_PRIORITY; break;
a0644dbbd30adb9bd2937110d6f016e56c4cc52bvboxsync case RTTHREADTYPE_MSG_PUMP: iPriority = B_DISPLAY_PRIORITY; break;
a0644dbbd30adb9bd2937110d6f016e56c4cc52bvboxsync case RTTHREADTYPE_IO: iPriority = B_URGENT_DISPLAY_PRIORITY; break;
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync case RTTHREADTYPE_TIMER: iPriority = B_REAL_TIME_DISPLAY_PRIORITY; break;
a2d9f81753c129b5e3bbe3769627dcd25a3724bdvboxsync status = set_thread_priority((thread_id)pThread->Core.Key, iPriority);
3a8aa22ef125135ef67bfc396771bcee15ef02dfvboxsync * Native kernel thread wrapper function.
23777a84b3e56937722404214b6064a797daf7b6vboxsync * This will forward to rtThreadMain and do termination upon return.
914fe6f35c397cfd7d97b44a63398c6422579c49vboxsync * @param pvArg Pointer to the argument package.
914fe6f35c397cfd7d97b44a63398c6422579c49vboxsync * @param Ignored Wait result, which we ignore.
914fe6f35c397cfd7d97b44a63398c6422579c49vboxsync int rc = rtThreadMain(pThread, (RTNATIVETHREAD)Self, &pThread->szName[0]);
914fe6f35c397cfd7d97b44a63398c6422579c49vboxsyncint rtThreadNativeCreate(PRTTHREADINT pThreadInt, PRTNATIVETHREAD pNativeThread)
824ae3158a8b8f8233fec3f5a12c81f139933698vboxsync NativeThread = spawn_kernel_thread(rtThreadNativeMain, pThreadInt->szName, B_NORMAL_PRIORITY, pThreadInt);