VirtualBox

Ignore:
Timestamp:
Sep 20, 2012 12:31:54 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
80830
Message:

Haiku Additions: cleanup, missed file.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/haiku/VBoxVideo/driver/driver.cpp

    r43364 r43366  
    7777struct Benaphore
    7878{
    79         sem_id    sem;
    80         int32    count;
    81 
    82         status_t Init(const char *name)
    83         {
    84             count = 0;
    85             sem = create_sem(0, name);
    86             return sem < 0 ? sem : B_OK;
    87         }
    88 
    89         status_t Acquire()
    90         {
    91             if (atomic_add(&count, 1) > 0)
    92                 return acquire_sem(sem);
    93             return B_OK;
    94         }
    95 
    96         status_t Release()
    97         {
    98             if (atomic_add(&count, -1) > 1)
    99                 return release_sem(sem);
    100             return B_OK;
    101         }
    102 
    103         void Delete()
    104                 {
    105                         delete_sem(sem);
    106                 }
     79    sem_id    sem;
     80    int32    count;
     81
     82    status_t Init(const char *name)
     83    {
     84        count = 0;
     85        sem = create_sem(0, name);
     86        return sem < 0 ? sem : B_OK;
     87    }
     88
     89    status_t Acquire()
     90    {
     91        if (atomic_add(&count, 1) > 0)
     92            return acquire_sem(sem);
     93        return B_OK;
     94    }
     95
     96    status_t Release()
     97    {
     98        if (atomic_add(&count, -1) > 1)
     99            return release_sem(sem);
     100        return B_OK;
     101    }
     102
     103    void Delete()
     104    {
     105        delete_sem(sem);
     106    }
    107107};
    108108
    109109struct DeviceInfo
    110110{
    111         uint32          openCount;                      // count of how many times device has been opened
    112         uint32          flags;                                  // device flags
    113         area_id         sharedArea;                     // area shared between driver and all accelerants
    114         SharedInfo     *sharedInfo;                     // pointer to shared info area memory
    115         pci_info        pciInfo;                        // copy of pci info for this device
    116         char            name[B_OS_NAME_LENGTH]; // name of device
     111    uint32          openCount;                  // count of how many times device has been opened
     112    uint32          flags;                                      // device flags
     113    area_id         sharedArea;                 // area shared between driver and all accelerants
     114    SharedInfo     *sharedInfo;                 // pointer to shared info area memory
     115    pci_info        pciInfo;                    // copy of pci info for this device
     116    char            name[B_OS_NAME_LENGTH]; // name of device
    117117};
    118118
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