示例#1
0
UInt8 IOMappedRead8(IOPhysicalAddress address)
{
    IOMapper::checkForSystemMapper();

    if (IOMapper::gSystem) {
        addr64_t addr = IOMapper::gSystem->mapToPhysicalAddress(address);
        return (UInt8) ml_phys_read_byte_64(addr);
    }
    else
        return (UInt8) ml_phys_read_byte((vm_offset_t) address);
}
示例#2
0
static void read_write(void *p, int a) {
	unsigned int val;
	int i = 0;
	byte8 =  ml_phys_read_byte((vm_offset_t) addr32);
	printf("KEXT:read at %#x %u\n",  addr32, byte8);
	val = byte8 | 0x4;
	printf("KEXT:get %u \n", val);
	thr_run = 1;
	while (thr_run == 1) {
		ml_phys_write_byte((vm_offset_t) addr32, val);
		printf("KEXT[%u]:write at %#x %u\n",i , addr32, val);
		i++;
		delay(io_delay);	
	}
	
	return;
}