1 |
/* |
/* |
2 |
* Copyright (C) 2005-2006 Anders Gavare. All rights reserved. |
* Copyright (C) 2005-2007 Anders Gavare. All rights reserved. |
3 |
* |
* |
4 |
* Redistribution and use in source and binary forms, with or without |
* Redistribution and use in source and binary forms, with or without |
5 |
* modification, are permitted provided that the following conditions are met: |
* modification, are permitted provided that the following conditions are met: |
25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: dev_pmppc.c,v 1.6 2006/01/01 13:17:17 debug Exp $ |
* $Id: dev_pmppc.c,v 1.8 2007/01/29 18:06:52 debug Exp $ |
29 |
* |
* |
30 |
* PM/PPC devices. |
* PM/PPC devices. |
31 |
* |
* |
37 |
#include <string.h> |
#include <string.h> |
38 |
|
|
39 |
#include "cpu.h" |
#include "cpu.h" |
40 |
#include "devices.h" |
#include "device.h" |
41 |
#include "machine.h" |
#include "machine.h" |
42 |
#include "memory.h" |
#include "memory.h" |
43 |
#include "misc.h" |
#include "misc.h" |
53 |
}; |
}; |
54 |
|
|
55 |
|
|
|
/* |
|
|
* dev_pmppc_board_access(): |
|
|
*/ |
|
56 |
DEVICE_ACCESS(pmppc_board) |
DEVICE_ACCESS(pmppc_board) |
57 |
{ |
{ |
58 |
struct pmppc_data *d = extra; |
struct pmppc_data *d = extra; |
110 |
} |
} |
111 |
|
|
112 |
|
|
113 |
/* |
DEVINIT(pmppc) |
|
* dev_pmppc_init(): |
|
|
*/ |
|
|
void dev_pmppc_init(struct memory *mem) |
|
114 |
{ |
{ |
115 |
struct pmppc_data *d; |
struct pmppc_data *d; |
116 |
|
struct memory *mem = devinit->machine->memory; |
117 |
|
|
118 |
d = malloc(sizeof(struct pmppc_data)); |
d = malloc(sizeof(struct pmppc_data)); |
119 |
if (d == NULL) { |
if (d == NULL) { |
159 |
|
|
160 |
memory_device_register(mem, "pmppc_board", |
memory_device_register(mem, "pmppc_board", |
161 |
PMPPC_CONFIG0, 0x10, dev_pmppc_board_access, d, DM_DEFAULT, NULL); |
PMPPC_CONFIG0, 0x10, dev_pmppc_board_access, d, DM_DEFAULT, NULL); |
162 |
|
|
163 |
|
return 1; |
164 |
} |
} |
165 |
|
|