Changeset 152 for sbliveos2/trunk/lib32
- Timestamp:
- Jul 17, 2000, 8:37:33 PM (25 years ago)
- Location:
- sbliveos2/trunk/lib32
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sbliveos2/trunk/lib32/memory.cpp
r148 r152 129 129 void __copy_user(void *to, const void *from, unsigned long n) 130 130 { 131 if(to == NULL || from == NULL) { 132 DebugInt3(); 133 return; 134 } 135 if(n == 0) return; 131 136 #ifdef KEE 132 137 memcpy(to, from, n); … … 139 144 unsigned long copy_to_user(void *to, const void *from, unsigned long n) 140 145 { 146 if(to == NULL || from == NULL) { 147 DebugInt3(); 148 return 0; 149 } 150 if(n == 0) return 0; 141 151 #ifdef KEE 142 152 memcpy(to, from, n); … … 150 160 void __copy_user_zeroing(void *to, const void *from, unsigned long n) 151 161 { 162 if(to == NULL || from == NULL) { 163 DebugInt3(); 164 return; 165 } 166 if(n == 0) return; 152 167 copy_to_user(to, from, n); 153 168 } … … 156 171 unsigned long copy_from_user(void *to, const void *from, unsigned long n) 157 172 { 173 if(to == NULL || from == NULL) { 174 DebugInt3(); 175 return 0; 176 } 177 if(n == 0) return 0; 158 178 #ifdef KEE 159 179 memcpy(to, from, n); … … 167 187 int get_user(int size, void *dest, void *src) 168 188 { 189 if(size == 0) return 0; 190 191 if(dest == NULL || src == NULL) { 192 DebugInt3(); 193 return 0; 194 } 169 195 #ifdef KEE 170 196 memcpy(dest, src, size); … … 178 204 int put_user(int x, void *ptr) 179 205 { 206 if(ptr == NULL) { 207 DebugInt3(); 208 return 0; 209 } 210 180 211 *(int *)ptr = x; 181 212 return 0; … … 200 231 char near *addr; 201 232 233 if(size == 0) { 234 DebugInt3(); 235 return NULL; 236 } 202 237 if(size > 1024) { 203 238 #ifdef KEE -
sbliveos2/trunk/lib32/sound.c
r151 r152 451 451 //****************************************************************************** 452 452 //****************************************************************************** 453 ULONG OSS32_StreamGetSpace(ULONG streamtype, ULONG streamid) 454 { 455 struct inode ossinode; 456 struct file ossfile; 457 struct dentry ossdentry; 458 ULONG ossid = streamtype & OSS_IDMASK; 459 audio_buf_info info; 460 char NEAR *tmpbuf; 461 ULONG cmd; 462 int transferred; 463 464 ossinode.i_rdev = ossid; 465 ossfile.private_data = (void *)streamid; 466 ossfile.f_flags = 0; 467 ossfile.f_dentry = &ossdentry; 468 ossdentry.d_inode = &ossinode; 469 470 switch(streamtype) { 471 case OSS_STREAM_WAVEOUT: 472 ossfile.f_mode = FMODE_WRITE; 473 cmd = SNDCTL_DSP_GETOSPACE; 474 break; 475 case OSS_STREAM_WAVEIN: 476 ossfile.f_mode = FMODE_READ; 477 cmd = SNDCTL_DSP_GETISPACE; 478 break; 479 case OSS_STREAM_MIDIOUT: 480 ossfile.f_mode = FMODE_WRITE; 481 break; 482 case OSS_STREAM_MIDIIN: 483 ossfile.f_mode = FMODE_READ; 484 break; 485 } 486 487 if(!oss_devices[ossid].write || !oss_devices[ossid].read || !oss_devices[ossid].ioctl) { 488 return 0; 489 } 490 //check how much room is left in the circular dma buffer 491 #ifdef KEE 492 tmpbuf = (char NEAR *)&info; 493 #else 494 tmpbuf = (char NEAR *)__StackToFlat((ULONG)&info); 495 #endif 496 if(oss_devices[ossid].ioctl(&ossinode, &ossfile, cmd, (ULONG)tmpbuf)) { 497 return 0; 498 } 499 return info.bytes; 500 } 501 //****************************************************************************** 502 //****************************************************************************** 453 503 ULONG OSS32_SetVolume(ULONG streamtype, ULONG streamid, ULONG cmd, ULONG volume) 454 504 {
Note:
See TracChangeset
for help on using the changeset viewer.