Reduced chattiness of threading, x86 IRQs and BochsGA
[tpg/acess2.git] / KernelLand / Modules / Display / BochsGA / bochsvbe.c
index 806c1c1..70f0c91 100644 (file)
@@ -63,8 +63,8 @@ void  BGA_int_SetMode(Uint16 width, Uint16 height);
  int   BGA_int_ModeInfo(tVideo_IOCtl_Mode *info);\r
  int   BGA_int_MapFB(void *Dest);\r
 // Filesystem\r
-Uint64 BGA_Read(tVFS_Node *Node, Uint64 off, Uint64 len, void *buffer);\r
-Uint64 BGA_Write(tVFS_Node *Node, Uint64 off, Uint64 len, const void *buffer);\r
+size_t BGA_Read(tVFS_Node *Node, off_t off, size_t len, void *buffer);\r
+size_t BGA_Write(tVFS_Node *Node, off_t off, size_t len, const void *buffer);\r
  int   BGA_IOCtl(tVFS_Node *Node, int ID, void *Data);\r
 \r
 // === GLOBALS ===\r
@@ -103,6 +103,10 @@ int BGA_Install(char **Arguments)
        // Check BGA Version\r
        version = BGA_int_ReadRegister(VBE_DISPI_INDEX_ID);\r
        LOG("version = 0x%x", version);\r
+       if( version == 0xFFFF ) {\r
+               // Floating bus, nothing there\r
+               return MODULE_ERR_NOTNEEDED;\r
+       }\r
        \r
        // NOTE: This driver was written for BGA versions >= 0xBOC2\r
        // NOTE: However, Qemu is braindead and doesn't return the actual version\r
@@ -141,10 +145,9 @@ void BGA_Uninstall(void)
 }\r
 \r
 /**\r
- * \fn Uint64 BGA_Read(tVFS_Node *node, Uint64 off, Uint64 len, void *buffer)\r
  * \brief Read from the framebuffer\r
  */\r
-Uint64 BGA_Read(tVFS_Node *node, Uint64 off, Uint64 len, void *buffer)\r
+size_t BGA_Read(tVFS_Node *node, off_t off, size_t len, void *buffer)\r
 {\r
        // Check Mode\r
        if(giBGA_CurrentMode == -1)     return -1;\r
@@ -161,7 +164,7 @@ Uint64 BGA_Read(tVFS_Node *node, Uint64 off, Uint64 len, void *buffer)
 /**\r
  * \brief Write to the framebuffer\r
  */\r
-Uint64 BGA_Write(tVFS_Node *Node, Uint64 Offset, Uint64 Length, const void *Buffer)\r
+size_t BGA_Write(tVFS_Node *Node, off_t Offset, size_t Length, const void *Buffer)\r
 {\r
        if( giBGA_CurrentMode == -1 )   BGA_int_UpdateMode(0);\r
        return DrvUtil_Video_WriteLFB(&gBGA_DrvUtil_BufInfo, Offset, Length, Buffer);\r

UCC git Repository :: git.ucc.asn.au