--- trunk/src/devices/dev_pmppc.c 2007/10/08 16:19:23 20 +++ trunk/src/devices/dev_pmppc.c 2007/10/08 16:21:17 34 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005 Anders Gavare. All rights reserved. + * Copyright (C) 2005-2007 Anders Gavare. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * - * $Id: dev_pmppc.c,v 1.5 2005/11/17 13:53:42 debug Exp $ + * $Id: dev_pmppc.c,v 1.8 2007/01/29 18:06:52 debug Exp $ * * PM/PPC devices. * @@ -37,7 +37,7 @@ #include #include "cpu.h" -#include "devices.h" +#include "device.h" #include "machine.h" #include "memory.h" #include "misc.h" @@ -53,12 +53,7 @@ }; -/* - * dev_pmppc_board_access(): - */ -int dev_pmppc_board_access(struct cpu *cpu, struct memory *mem, - uint64_t relative_addr, unsigned char *data, size_t len, int writeflag, - void *extra) +DEVICE_ACCESS(pmppc_board) { struct pmppc_data *d = extra; uint64_t idata = 0, odata = 0; @@ -115,12 +110,10 @@ } -/* - * dev_pmppc_init(): - */ -void dev_pmppc_init(struct memory *mem) +DEVINIT(pmppc) { struct pmppc_data *d; + struct memory *mem = devinit->machine->memory; d = malloc(sizeof(struct pmppc_data)); if (d == NULL) { @@ -166,5 +159,7 @@ memory_device_register(mem, "pmppc_board", PMPPC_CONFIG0, 0x10, dev_pmppc_board_access, d, DM_DEFAULT, NULL); + + return 1; }