Ejemplo n.º 1
0
static void
km_remove_ext4_mod(
    const char* const       data
)
{
    unsigned long			cr0 = disable_wp();

    km_ext4_ops_remove_readdir();

    restore_wp( cr0 );
}
Ejemplo n.º 2
0
/*
 * Write bytes to kernel address space for debugger.
 * We need to disable write protection temporarily so we can write
 * things (such as break points) that might be in write-protected
 * memory.
 */
int
db_write_bytes(vm_offset_t addr, size_t size, char *data)
{
	jmp_buf jb;
	void *prev_jb;
	char *dst;
	bool old_wp;
	int ret;

	old_wp = false;
	prev_jb = kdb_jmpbuf(jb);
	ret = setjmp(jb);
	if (ret == 0) {
		old_wp = disable_wp();
		dst = (char *)addr;
		while (size-- > 0)
			*dst++ = *data++;
	}
	restore_wp(old_wp);
	(void)kdb_jmpbuf(prev_jb);
	return (ret);
}