Changeset 43366 in vbox for trunk/src/VBox/Additions/haiku/VBoxVideo
- Timestamp:
- Sep 20, 2012 12:31:54 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 80830
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/haiku/VBoxVideo/driver/driver.cpp
r43364 r43366 77 77 struct Benaphore 78 78 { 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 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 } 107 107 }; 108 108 109 109 struct DeviceInfo 110 110 { 111 112 113 114 115 116 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 117 117 }; 118 118
Note:
See TracChangeset
for help on using the changeset viewer.