25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: dev_kn01.c,v 1.10 2007/01/05 15:20:06 debug Exp $ |
* $Id: dev_kn01.c,v 1.11 2007/06/15 19:11:15 debug Exp $ |
29 |
* |
* |
30 |
* KN01 stuff ("PMAX", DECstation type 1); CSR (System Control Register) |
* COMMENT: DEC KN01 ("PMAX", DECstation type 1) control register and VDAC |
|
* and VDAC. |
|
31 |
* |
* |
32 |
* TODO: The CSR isn't really complete. |
* TODO: The CSR isn't really complete. |
33 |
* |
* |
235 |
void dev_vdac_init(struct memory *mem, uint64_t baseaddr, |
void dev_vdac_init(struct memory *mem, uint64_t baseaddr, |
236 |
unsigned char *rgb_palette, int color_fb_flag) |
unsigned char *rgb_palette, int color_fb_flag) |
237 |
{ |
{ |
238 |
struct vdac_data *d = malloc(sizeof(struct vdac_data)); |
struct vdac_data *d; |
239 |
if (d == NULL) { |
|
240 |
fprintf(stderr, "out of memory\n"); |
CHECK_ALLOCATION(d = malloc(sizeof(struct vdac_data))); |
|
exit(1); |
|
|
} |
|
241 |
memset(d, 0, sizeof(struct vdac_data)); |
memset(d, 0, sizeof(struct vdac_data)); |
242 |
|
|
243 |
d->rgb_palette = rgb_palette; |
d->rgb_palette = rgb_palette; |
244 |
d->color_fb_flag = color_fb_flag; |
d->color_fb_flag = color_fb_flag; |
245 |
|
|
253 |
*/ |
*/ |
254 |
void dev_kn01_init(struct memory *mem, uint64_t baseaddr, int color_fb) |
void dev_kn01_init(struct memory *mem, uint64_t baseaddr, int color_fb) |
255 |
{ |
{ |
256 |
struct kn01_data *d = malloc(sizeof(struct kn01_data)); |
struct kn01_data *d; |
|
if (d == NULL) { |
|
|
fprintf(stderr, "out of memory\n"); |
|
|
exit(1); |
|
|
} |
|
257 |
|
|
258 |
|
CHECK_ALLOCATION(d = malloc(sizeof(struct kn01_data))); |
259 |
memset(d, 0, sizeof(struct kn01_data)); |
memset(d, 0, sizeof(struct kn01_data)); |
|
d->color_fb = color_fb; |
|
260 |
|
|
261 |
|
d->color_fb = color_fb; |
262 |
d->csr = 0; |
d->csr = 0; |
263 |
d->csr |= (color_fb? 0 : KN01_CSR_MONO); |
d->csr |= (color_fb? 0 : KN01_CSR_MONO); |
264 |
|
|