VirtualBox

Ignore:
Timestamp:
Aug 24, 2009 3:47:01 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
51399
Message:

IPRT: RTThreadPreemptDisble/Restore must work the SPL/PIL as well for the code to work reliably on S10.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/solaris/vbi/thread-r0drv-solaris.c

    r22407 r22418  
    55
    66/*
    7  * Copyright (C) 2006-2007 Sun Microsystems, Inc.
     7 * Copyright (C) 2006-2009 Sun Microsystems, Inc.
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    8282{
    8383    Assert(hThread == NIL_RTTHREAD);
    84     if (    vbi_is_preempt_enabled()
    85         &&  ASMIntAreEnabled()
    86         &&  getpil() < DISP_LEVEL)
    87         return true;
    88     return false;
     84    if (!vbi_is_preempt_enabled())
     85        return false;
     86    if (!ASMIntAreEnabled())
     87        return false;
     88    if (getpil() >= DISP_LEVEL)
     89        return false;
     90    return true;
    8991}
    9092
     
    114116{
    115117    AssertPtr(pState);
    116     Assert(pState->u32Reserved == 0);
    117     pState->u32Reserved = 42;
     118    Assert(pState->uOldPil == UINT32_MAX);
     119
    118120    vbi_preempt_disable();
     121/// @todo check out splr and splx on S10!
     122//    if (ASMIntAreEnabled())
     123        pState->uOldPil = splr(ipltospl(DISP_LEVEL));
     124//    else
     125//    {
     126//        /* splr doesn't restore the interrupt flag on S10. */
     127//        pState->uOldPil = getpil();
     128//        if (pState->uOldPil < DISP_LEVEL)
     129//            pState->uOldPil = splx(DISP_LEVEL);
     130//    }
     131
     132    Assert(pState->uOldPil != UINT32_MAX)
    119133    RT_ASSERT_PREEMPT_CPUID_DISABLE(pState);
    120134}
     
    124138{
    125139    AssertPtr(pState);
    126     Assert(pState->u32Reserved == 42);
    127     pState->u32Reserved = 0;
     140    Assert(pState->uOldPil != UINT32_MAX)
    128141    RT_ASSERT_PREEMPT_CPUID_RESTORE(pState);
     142
     143    splx(pState->uOldPil);
    129144    vbi_preempt_enable();
     145
     146    pState->uOldPil = UINT32_MAX;
    130147}
    131148
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