void FDD_IRQHandler(int Num);\r
void FDD_WaitIRQ();\r
void FDD_SensInt(int base, Uint8 *sr0, Uint8 *cyl);\r
-inline void FDD_AquireSpinlock();\r
-inline void FDD_FreeSpinlock();\r
-#if USE_CACHE\r
-inline void FDD_AquireCacheSpinlock();\r
-inline void FDD_FreeCacheSpinlock();\r
-#endif\r
void FDD_int_SendByte(int base, char byte);\r
int FDD_int_GetByte(int base);\r
void FDD_Reset(int id);\r
LOG("Cyl=%i, Head=%i, Sector=%i", cyl, head, sec);\r
LOG("Acquire Spinlock");\r
\r
- FDD_AquireSpinlock();\r
+ LOCK(&glFDD);\r
\r
// Seek to track\r
outb(base + CALIBRATE_DRIVE, 0);\r
\r
// Release Spinlock\r
LOG("Realeasing Spinlock and setting motor to stop");\r
- FDD_FreeSpinlock();\r
+ RELEASE(&glFDD);\r
\r
// Don't turn the motor off now, wait for a while\r
gFDD_Devices[Disk].timer = Time_CreateTimer(MOTOR_OFF_DELAY, FDD_int_StopMotor, (void*)Disk);
else FDD_int_GetByte(base);\r
}\r
\r
-inline void FDD_AquireSpinlock()\r
-{\r
- LOCK(&glFDD);\r
-}\r
-\r
-inline void FDD_FreeSpinlock()\r
-{\r
- RELEASE(&glFDD)\r
-}\r
-\r
/**\r
* void FDD_int_SendByte(int base, char byte)\r
* \brief Sends a command to the controller\r
*/\r
void ModuleUnload()\r
{\r
- int i;\r
- FDD_AquireSpinlock();\r
+ int i;\r
+ //DevFS_DelDevice( &gFDD_DriverInfo );\r
+ LOCK(&glFDD);\r
for(i=0;i<4;i++) {\r
Time_RemoveTimer(gFDD_Devices[i].timer);\r
FDD_int_StopMotor(i);\r
}\r
+ RELEASE(&glFDD);\r
//IRQ_Clear(6);\r
}\r