Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
mipsivm/src/include/devkit.h
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
49 lines (38 sloc)
1.36 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
mipsivm - MIPS Interpreting Virtual Machine | |
Copyright(c) 2018-2021, Yaotian "Zero" Tang. All rights reserved. | |
This file defines the development kits for mipsivm project. | |
This program is distributed in the hope that it will be useful, but | |
without any warranty (no matter implied warranty or merchantability | |
or fitness for a particular purpose, etc.). | |
File Location: /include/devkit.h | |
*/ | |
#include "midef.h" | |
#define page_size 0x1000 | |
#define pfn(x) (x>>12) | |
bool mips_init_mars_vm(void* ds,void* ts,u32 ds_size,u32 ts_size,u32 stack_size,bool break_on_start); | |
void mips_run_mars_vm(); | |
void mips_final_mars_vm(); | |
void cdecl sim_printf(const char* format,...); | |
void cdecl sim_snprintf(char* string,u32 length,const char* format,...); | |
i32 sim_readint(); | |
float sim_readfloat(); | |
double sim_readdouble(); | |
void sim_readstring(char* string,u32 limit); | |
char sim_readchar(); | |
void sim_setseed(u32 seed); | |
u32 sim_getrand(); | |
void report_memory_introspection(); | |
void* load_section(char* file_path,u32* size); | |
bool unload_section(void* section); | |
void* alloc_page(u32 size); | |
bool free_page(void* address); | |
void* alloc_mem(u32 size); | |
bool free_mem(void* address); | |
#if defined(_msvc) | |
#define intrin_bt _bittest | |
#define intrin_bts _bittestandset | |
#define intrin_btr _bittestandreset | |
#define intrin_btc _bittestandcomplement | |
#define intrin_locked_xchg _InterlockedExchange | |
#endif |