Lines Matching defs:state
179 bios_allocate_mem(bios_state* state, size_t size)
186 if (state->allocated_size + size > kRAMSize)
190 = (void*)(state->mapped_address + kRAMBase + state->allocated_size);
191 state->allocated_size += size;
198 bios_physical_address(bios_state* state, void* virtualAddress)
200 return (uint32)((addr_t)virtualAddress - state->mapped_address);
205 bios_virtual_address(bios_state* state, uint32 physicalAddress)
207 return (void*)((addr_t)physicalAddress + state->mapped_address);
216 BIOSState* state = new(std::nothrow) BIOSState;
217 if (state == NULL)
219 ObjectDeleter<BIOSState> stateDeleter(state);
223 (void**)&state->mapped_address, B_ANY_KERNEL_ADDRESS,
229 state->area = create_area("bios", (void**)&state->mapped_address,
232 if (state->area < B_OK) {
234 (void*)state->mapped_address, kTotalSize);
235 return state->area;
239 status = vm_memcpy_from_physical((void*)state->mapped_address, kBDABase,
243 (void*)state->mapped_address, kTotalSize);
248 void* address = (void*)(state->mapped_address + kEBDABase);
253 (void*)state->mapped_address, kTotalSize);
261 *_state = state;
267 bios_interrupt(bios_state* state, uint8 vector, bios_regs* regs)
269 sCurrentBIOSState = state;
272 void* stack = bios_allocate_mem(state, kStackSize);
275 uint32 stackTop = bios_physical_address(state, stack) + kStackSize;
280 void* halt = bios_allocate_mem(state, 1);
295 M.x86.R_EIP = bios_physical_address(state, halt);
329 bios_finish(bios_state* state)
333 delete state;