FreeBSD/sys/riscv/riscv/db_interface.c
/*
 * Write bytes to kernel address space for debugger.
 */
Write bytes to kernel address space for debugger.
Write bytes to kernel address space for debugger .
int
db_write_bytes(vm_offset_t addr, size_t size, char *data)
{
	jmp_buf jb;
	void *prev_jb;
	char *dst;
	int ret;
	prev_jb = kdb_jmpbuf(jb);
	ret = setjmp(jb);
	if (ret == 0) {
		dst = (char *)addr;
		while (size-- > 0)
			*dst++ = *data++;
		fence();
		cpu_dcache_wb_range(addr, (vm_size_t)size);
		cpu_icache_sync_range(addr, (vm_size_t)size);
	}
	(void)kdb_jmpbuf(prev_jb);
	return (ret);
}
int db_write_bytes ( vm_offset_t addr , size_t size , char * data ) { jmp_buf jb ; void * prev_jb ; char * dst ; int ret ; prev_jb = kdb_jmpbuf ( jb ) ; ret = setjmp ( jb ) ; if ( ret == 0 ) { dst = ( char * ) addr ; while ( size -- > 0 ) * dst ++ = * data ++ ; fence ( ) ; cpu_dcache_wb_range ( addr , ( vm_size_t ) size ) ; cpu_icache_sync_range ( addr , ( vm_size_t ) size ) ; } ( void ) kdb_jmpbuf ( prev_jb ) ; return ( ret ) ; }
Write bytes to kernel address space for debugger.
Write bytes to kernel address space for debugger .
/* Clean D-cache and invalidate I-cache */