1 This file attempts to document the functions made publically available by
2 the various subsystems.
4 * Formatted I/O operations *
6 NAME: int vsprintf(char *buf, const char *fmt, va_list args)
7 NAME: int sprintf(char* buf, const char* fmt, ...)
8 WHERE: internal/kernel.h
9 FUNCTION: The same as the standard c library versions
15 FUNCTION: Read an IO port of the specified size (byte/word or long)
16 RETURNS: The value read
18 NAME: out[b/w/l](port,val)
20 FUNCTION: Write an IO port of the specified size (byte/word or long)
22 NAME: in_p[b/w/l](port)
24 FUNCTION: Read an IO port of the specified size (byte/word or long) with
26 RETURNS: The value read
28 NAME: out_p[b/w/l](port,val)
30 FUNCTION: Write an IO port of the specified size (byte/word or long) with
35 NAME: int set_bit(int nr, void* addr)
36 NAME: int clear_bit(int nr, void* addr)
37 NAME: int change_bit(int nr, void* addr)
38 WHERE: internal/bitops.h>
39 FUNCTION: Operate on a bit in the word pointed to by addr
40 RETURN: 0 if the bit was cleared before the operations
43 * Debugging functions *
45 NAME: DPRINT(fmt,....)
46 WHERE: internal/debug.h
47 FUNCTION: Outputs a string to the console if NDEBUG isn't defined before
48 including internal/debug.h, a NOP otherwise
49 ARGUMENTS: The same as printf
52 WHERE: internal/kernel.h
53 FUNCTION: Outputs a string to the console
54 ARGUMENTS: The same as printf
56 * Memory managment functions *
58 NAME: unsigned int physical_to_linear(unsigned int paddr)
60 FUNCTION: Converts a physical address to a linear one
62 paddr = the physical address to convert
63 RETURNS: A virtual address where the memory at that physical address can be
66 NAME: void* ExAllocatePool(unsigned int size, unsigned int type = 0);
67 WHERE: internal/pool.h
68 FUNCTION: Allocates a block of memory
70 size = the size of the block to allocate
71 type = will be whether to allocate pagable memory
72 RETURNS: The address of the block
73 NOTE: This isn't interrupt safe
75 NAME: void ExFreePool(void* block)
76 WHERE: internal/pool.h
77 FUNCTION: Frees a block of memory
79 NAME: void free_page(unsigned int physical_base, unsigned int nr = 1)
81 FUNCTION: Adds a continuous range of physical memory to the free list
83 NAME: unsigned int get_free_page(void)
85 FUNCTION: Gets a free page
86 RETURNS: Its physical address
88 NAME: unsigned int get_page_physical_address(unsigned int vaddr)
90 FUNCTION: Gets the physical address of a page
92 NAME: void mark_page_not_writable(unsigned int vaddr)
94 FUNCTION: Prevent writing the page
98 NAME: unsigned int get_dma_page(unsigned int max_address)
100 FUNCTION: Gets a page with a restricted physical address i.e. suitable for
102 RETURNS: The physical address of the page
104 NAME: void disable_dma(unsigned int dmanr)
105 WHERE: internal/dma.h
106 FUNCTION: Disables the specified dma channel
108 NAME: void enable_dma(unsigned int dmanr)
109 WHERE: internal/dma.h
110 FUNCTION: Enables the specified dma channel
112 NAME: void clear_dma_ff(unsigned int dmanr)
113 WHERE: internal/dma.h
114 FUNCTION: Clear the dma flip-flop
116 NAME: void set_dma_mode(unsigned int dmanr, char mode)
117 WHERE: internal/dma.h
118 FUNCTION: Sets the type of dma transfer
120 NAME: void set_dma_page(unsigned int dmanr, char pagenr)
121 WHERE: internal/dma.h
122 FUNCTION: Set only the page register bits of the transfer address
124 NAME: void set_dma_addr(unsigned int dmanr, unsigned int a)
125 WHERE: internal/dma.h
126 FUNCTION: Set the transfer address for dma
127 NOTE: Assumes flip-flop is clear
129 NAME: void set_dma_count(unsigned int dmanr, unsigned int count)
130 WHERE: internal/dma.h
131 FUNCTION: Sets the size of the transfer
133 count = the number of bytes to transfer
134 NOTE: Count must be even for channels 5-7
136 NAME: int get_dma_residue(unsigned int dmanr)
137 WHERE: internal/dma.h
138 FUNCTION: Gets the residue remaining after a dma transfer on the channel