* \param Offset Source Offset
* \return Host pointer to the emulated memory
*/
-extern void *VM8086_GetPointer(tVM8086 *State, Uint16 Segment, Uint16 Ofs);
+extern void *VM8086_GetPointer(tVM8086 *State, Uint16 Segment, Uint16 Offset);
/**
* \brief Calls a real-mode interrupt described by the current state of the IVT.
* \param State Emulator State
}
/**
- * \fn void Time_Interrupt(void)
* \brief Called on the timekeeping IRQ
+ * \param irq IRQ number (unused)
*/
void Time_Interrupt(int irq)
{
* \param Offset Source Offset
* \return Host pointer to the emulated memory
*/
-extern void *VM8086_GetPointer(tVM8086 *State, Uint16 Segment, Uint16 Ofs);
+extern void *VM8086_GetPointer(tVM8086 *State, Uint16 Segment, Uint16 Offset);
/**
* \brief Calls a real-mode interrupt described by the current state of the IVT.
* \param State Emulator State
/**
* \brief Allocate a contiguous range of physical pages with a maximum
- * bit size of \a Bits
- * \param Num Number of pages to allocate
- * \param Bits Maximum size of the physical address
- * \note If \a Bits is <= 0, any sized address is used (with preference
+ * bit size of \a MaxBits
+ * \param Pages Number of pages to allocate
+ * \param MaxBits Maximum size of the physical address
+ * \note If \a MaxBits is <= 0, any sized address is used (with preference
* to higher addresses)
*/
-tPAddr MM_AllocPhysRange(int Num, int Bits)
+tPAddr MM_AllocPhysRange(int Pages, int MaxBits)
{
tPAddr addr, ret;
int rangeID;
int nFree = 0, i;
- ENTER("iNum iBits", Num, Bits);
+ ENTER("iPages iBits", Pages, MaxBits);
- if( Bits <= 0 || Bits >= 64 ) // Speedup for the common case
+ if( MaxBits <= 0 || MaxBits >= 64 ) // Speedup for the common case
rangeID = MM_PHYS_MAX;
else
- rangeID = MM_int_GetRangeID( (1LL << Bits) - 1 );
+ rangeID = MM_int_GetRangeID( (1LL << MaxBits) - 1 );
LOG("rangeID = %i", rangeID);
Warning(" MM_AllocPhysRange: Out of free pages");
Log_Warning("Arch",
"Out of memory (unable to fulfil request for %i pages), zero remaining",
- Num
+ Pages
);
LEAVE('i', 0);
return 0;
}
// Check if there is enough in the range
- if(giPhysRangeFree[rangeID] >= Num)
+ if(giPhysRangeFree[rangeID] >= Pages)
{
LOG("{%i,0x%x -> 0x%x}",
giPhysRangeFree[rangeID],
}
nFree ++;
addr ++;
- LOG("nFree(%i) == %i (0x%x)", nFree, Num, addr);
+ LOG("nFree(%i) == %i (0x%x)", nFree, Pages, addr);
if(nFree == Num)
break;
}
LOG("nFree = %i", nFree);
// If we don't find a contiguous block, nFree will not be equal
// to Num, so we set it to zero and do the expensive lookup.
- if(nFree != Num) nFree = 0;
+ if(nFree != Pages) nFree = 0;
}
if( !nFree )
LOG("nFree = %i, addr = 0x%08x", nFree, addr);
// Mark pages as allocated
- addr -= Num;
- for( i = 0; i < Num; i++, addr++ )
+ addr -= Pages;
+ for( i = 0; i < Pages; i++, addr++ )
{
gaMainBitmap[addr >> 6] |= 1LL << (addr & 63);
rangeID = MM_int_GetRangeID(addr << 12);
ret = addr; // Save the return address
// Update super bitmap
- Num += addr & (64-1);
+ Pages += addr & (64-1);
addr &= ~(64-1);
- Num = (Num + (64-1)) & ~(64-1);
- for( i = 0; i < Num/64; i++ )
+ Pages = (Pages + (64-1)) & ~(64-1);
+ for( i = 0; i < Pages/64; i++ )
{
if( gaMainBitmap[ addr >> 6 ] + 1 == 0 )
gaSuperBitmap[addr>>12] |= 1LL << ((addr >> 6) & 63);
\r
// === CODE ===\r
/**\r
- * \fn int DMA_Install(void)\r
* \brief Initialise DMA channels\r
+ * \param Arguments Arguments passed at boot time\r
*/\r
int DMA_Install(char **Arguments)\r
{\r
// === CODE ===
/**
- * \fn int KB_Install(char **Arguments)
+ * \brief Install the keyboard driver
*/
int KB_Install(char **Arguments)
{
}
/**
- * \fn void KB_IRQHandler()
* \brief Called on a keyboard IRQ
+ * \param IRQNum IRQ number (unused)
*/
void KB_IRQHandler(int IRQNum)
{
\r
// === CODE ===\r
/**\r
- * \fn int PCI_Install()\r
* \brief Scan the PCI Bus for devices\r
+ * \param Arguments Boot-time parameters\r
*/\r
int PCI_Install(char **Arguments)\r
{\r
}
/**
- * \fn void *Heap_AllocateZero(const char *File, int Line, size_t size)
+ * \fn void *Heap_AllocateZero(const char *File, int Line, size_t Bytes)
* \brief Allocate and Zero a buffer in memory
* \param File Allocating file
* \param Line Line of allocation
- * \param size Size of the allocation
+ * \param Bytes Size of the allocation
*/
-void *Heap_AllocateZero(const char *File, int Line, size_t size)
+void *Heap_AllocateZero(const char *File, int Line, size_t Bytes)
{
- void *ret = Heap_Allocate(File, Line, size);
+ void *ret = Heap_Allocate(File, Line, Bytes);
if(ret == NULL) return NULL;
- memset( ret, 0, size );
+ memset( ret, 0, Bytes );
return ret;
}
/**
* \brief Allocate a contiguous range of physical pages
* \param Pages Number of pages to allocate
+ * \param MaxBits Maximum number of address bits allowed
* \return First physical address allocated
*/
extern tPAddr MM_AllocPhysRange(int Pages, int MaxBits);
* \brief Change the location of the current file pointer
* \param FD File handle returned by ::VFS_Open
* \param Offset Offset within the file to go to
- * \param Direction A direction from ::eVFS_SeekDirs
+ * \param Whence A direction from ::eVFS_SeekDirs
* \return Boolean success
*/
-extern int VFS_Seek(int FD, Sint64 Offset, int Direction);
+extern int VFS_Seek(int FD, Sint64 Offset, int Whence);
/**
* \brief Returns the current file pointer
* \param FD File handle returned by ::VFS_Open
return giRandomState;
}
-/// \name Memory Validation
-/// \{
+/* *
+ * \name Memory Validation
+ * \{
+ */
/**
* \brief Checks if a string resides fully in valid memory
*/
}
return 0;
}
-/// \}
+/* *
+ * \}
+ */
/**
* \brief Search a string array for \a Needle
/**
* \brief Initialise a builtin module given it's name
- * \example Used by VTerm to load an alternate video driver at runtime
+ *
+ * E.g. Used by VTerm to load an alternate video driver at runtime
*/
int Modules_InitialiseBuiltin(const char *Name)
{
}
/**
- * \biref Parse a module argument string
+ * \brief Parse a module argument string
+ * \param Arg Argument string
*/
void System_ParseModuleArgs(char *Arg)
{
}
/**
- * \fn tVFS_Node *DevFS_FindDir(tVFS_Node *Node, char *Name)
+ * \fn tVFS_Node *DevFS_FindDir(tVFS_Node *Node, const char *Name)
* \brief Get an entry from the devices directory
*/
tVFS_Node *DevFS_FindDir(tVFS_Node *Node, const char *Name)
}
/**
- * \fn char *VFS_ParsePath(char *Path, char **TruePath)
+ * \fn char *VFS_ParsePath(const char *Path, char **TruePath)
* \brief Parses a path, resolving sysmlinks and applying permissions
*/
tVFS_Node *VFS_ParsePath(const char *Path, char **TruePath)