1 |
/* |
/* |
2 |
* Copyright (C) 2006 Anders Gavare. All rights reserved. |
* Copyright (C) 2006-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_fbctrl.c,v 1.4 2006/07/09 07:53:33 debug Exp $ |
* $Id: dev_fbctrl.c,v 1.6 2007/06/15 19:11:15 debug Exp $ |
29 |
|
* |
30 |
|
* COMMENT: Framebuffer controller device (control's dev_fb in test machines) |
31 |
* |
* |
32 |
* A "framebuffer control" device. It can be used to manipulate the |
* A "framebuffer control" device. It can be used to manipulate the |
33 |
* framebuffer device in testmachines. |
* framebuffer device in testmachines. |
38 |
#include <string.h> |
#include <string.h> |
39 |
|
|
40 |
#include "cpu.h" |
#include "cpu.h" |
|
#include "cpu_mips.h" |
|
41 |
#include "device.h" |
#include "device.h" |
42 |
#include "devices.h" |
#include "devices.h" |
43 |
#include "machine.h" |
#include "machine.h" |
156 |
{ |
{ |
157 |
struct fbctrl_data *d; |
struct fbctrl_data *d; |
158 |
|
|
159 |
d = malloc(sizeof(struct fbctrl_data)); |
CHECK_ALLOCATION(d = malloc(sizeof(struct fbctrl_data))); |
|
if (d == NULL) { |
|
|
fprintf(stderr, "out of memory\n"); |
|
|
exit(1); |
|
|
} |
|
160 |
memset(d, 0, sizeof(struct fbctrl_data)); |
memset(d, 0, sizeof(struct fbctrl_data)); |
161 |
|
|
162 |
d->vfb_data = dev_fb_init(devinit->machine, devinit->machine->memory, |
d->vfb_data = dev_fb_init(devinit->machine, devinit->machine->memory, |