jit3-md.h

来自「linux下建立JAVA虚拟机的源码KAFFE」· C头文件 代码 · 共 55 行

H
55
字号
#ifndef __powerpc_darwin_jit3_md_h#define __powerpc_darwin_jit3_md_h#include "config.h"#include "powerpc/jit.h"/* * Initialize the exceptionFrame object "f" with the stack frame captured in * the given sigcontext structure. * * from ppc/signal.h sigcontext definition: void    *sc_regs;                (kernel private) saved state  */#define EXCEPTIONFRAME(f, c) \do { \	(f).sp = (ppc_stack_frame_t *)((register_storage_t *)c->sc_regs)[3]; \} while( 0 )/* * Flush newly generated instructions from the data cache and invalidate the * same blocks in the instruction cache. * * See section 5.2.5.2 of the PowerPC Programming Environments manual and * numerous usenet discussions on google. * * code_start - The start of the code, no special alignment required. * code_end - The end of the code. */#define FLUSH_DCACHE darwin_flush_cachestatic inline void darwin_flush_cache(void *code_start, void *code_end){	/*	 * The size of a block in the cache, we need to align the flushed	 * addresses to these blocks.	 */	static int cache_block_size = 32; // bytes	uintp curr, last;		curr = (uintp)code_start;	last = (uintp)code_end;	curr = (curr - cache_block_size) & ~(cache_block_size - 1);	last = (last + cache_block_size) & ~(cache_block_size - 1);	for( ; curr < last; curr += cache_block_size )	{		asm("dcbst 0, %0\n"		    "sync\n"		    "icbi 0, %0\n"		    "sync\n"		    "isync\n" : : "r" (curr));	}}#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?