VirtualBox

Changeset 15798 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jan 5, 2009 1:03:42 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
41375
Message:

implemented RTThreadPreemptDisable() and RTThreadPreemptRestore for Linux hosts

Location:
trunk/src/VBox/Runtime
Files:
1 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/Makefile.kmk

    r15400 r15798  
    10131013        generic/RTLogWriteStdOut-stub-generic.cpp \
    10141014        generic/mppresent-generic.cpp \
    1015         r0drv/generic/RTThreadPreemptDisable-r0drv-generic.cpp \
    1016         r0drv/generic/RTThreadPreemptRestore-r0drv-generic.cpp \
    10171015        r0drv/linux/alloc-r0drv-linux.c \
    10181016        r0drv/linux/assert-r0drv-linux.c \
     
    10231021        r0drv/linux/process-r0drv-linux.c \
    10241022        r0drv/linux/RTLogWriteDebugger-r0drv-linux.c \
     1023        r0drv/linux/RTThreadPreemptDisable-r0drv-linux.c \
     1024        r0drv/linux/RTThreadPreemptRestore-r0drv-linux.c \
    10251025        r0drv/linux/semevent-r0drv-linux.c \
    10261026        r0drv/linux/semeventmulti-r0drv-linux.c \
  • trunk/src/VBox/Runtime/r0drv/linux/RTThreadPreemptDisable-r0drv-linux.c

    r15797 r15798  
    55
    66/*
    7  * Copyright (C) 2008 Sun Microsystems, Inc.
     7 * Copyright (C) 2009 Sun Microsystems, Inc.
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3232*   Header Files                                                               *
    3333*******************************************************************************/
     34#include "the-linux-kernel.h"
     35
    3436#include <iprt/thread.h>
    3537#include <iprt/assert.h>
     
    3840RTDECL(void) RTThreadPreemptDisable(PRTTHREADPREEMPTSTATE pState)
    3941{
    40     AssertPtr(pState);
    41     Assert(pState->uchDummy != 42);
    42     pState->uchDummy = 42;
     42    /*
     43     * Note: This call is a NOP if CONFIG_PREEMPT is not enabled in the Linux kernel
     44     * configuration. In that case, schedule() is only called need_resched() is set
     45     * which is tested just before we return to R3 (not when returning from R0 to R0).
     46     */
     47    preempt_disable();
    4348}
    44 
  • trunk/src/VBox/Runtime/r0drv/linux/RTThreadPreemptRestore-r0drv-linux.c

    r15797 r15798  
    55
    66/*
    7  * Copyright (C) 2008 Sun Microsystems, Inc.
     7 * Copyright (C) 2009 Sun Microsystems, Inc.
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3232*   Header Files                                                               *
    3333*******************************************************************************/
     34#include "the-linux-kernel.h"
     35
    3436#include <iprt/thread.h>
    3537#include <iprt/assert.h>
     
    3840RTDECL(void) RTThreadPreemptRestore(PRTTHREADPREEMPTSTATE pState)
    3941{
    40     AssertPtr(pState);
    41     Assert(pState->uchDummy == 42);
    42     pState->uchDummy = 0;
     42    preempt_enable();
    4343}
    44 
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette