/[gxemul]/trunk/src/devices/dev_kn220.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/src/devices/dev_kn220.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 41 by dpavlin, Mon Oct 8 16:21:17 2007 UTC revision 42 by dpavlin, Mon Oct 8 16:22:32 2007 UTC
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *     *  
27   *   *
28   *  $Id: dev_kn220.c,v 1.7 2006/12/30 13:30:58 debug Exp $   *  $Id: dev_kn220.c,v 1.8 2007/06/15 19:11:15 debug Exp $
29   *     *  
30   *  DEC KN220 (DECsystem 5500) devices.   *  COMMENT: DEC KN220 (DECsystem 5500) devices
31   *   *
32   *      o)  I/O board   *      o)  I/O board
33   *      o)  SGEC (ethernet)  (Called "ne" in Ultrix.)   *      o)  SGEC (ethernet)  (Called "ne" in Ultrix.)
# Line 152  DEVICE_ACCESS(sgec) Line 152  DEVICE_ACCESS(sgec)
152   */   */
153  void dev_sgec_init(struct memory *mem, uint64_t baseaddr, int irq_nr)  void dev_sgec_init(struct memory *mem, uint64_t baseaddr, int irq_nr)
154  {  {
155          struct sgec_data *d = malloc(sizeof(struct sgec_data));          struct sgec_data *d;
156          if (d == NULL) {  
157                  fprintf(stderr, "out of memory\n");          CHECK_ALLOCATION(d = malloc(sizeof(struct sgec_data)));
                 exit(1);  
         }  
158          memset(d, 0, sizeof(struct sgec_data));          memset(d, 0, sizeof(struct sgec_data));
159    
160          d->irq_nr = irq_nr;          d->irq_nr = irq_nr;
161    
162          memory_device_register(mem, "sgec", baseaddr, DEV_SGEC_LENGTH,          memory_device_register(mem, "sgec", baseaddr, DEV_SGEC_LENGTH,
# Line 171  void dev_sgec_init(struct memory *mem, u Line 170  void dev_sgec_init(struct memory *mem, u
170  struct dec5500_ioboard_data *dev_dec5500_ioboard_init(struct cpu *cpu,  struct dec5500_ioboard_data *dev_dec5500_ioboard_init(struct cpu *cpu,
171          struct memory *mem, uint64_t baseaddr)          struct memory *mem, uint64_t baseaddr)
172  {  {
173          struct dec5500_ioboard_data *d =          struct dec5500_ioboard_data *d;
174              malloc(sizeof(struct dec5500_ioboard_data));  
175          if (d == NULL) {          CHECK_ALLOCATION(d = malloc(sizeof(struct dec5500_ioboard_data)));
                 fprintf(stderr, "out of memory\n");  
                 exit(1);  
         }  
176          memset(d, 0, sizeof(struct dec5500_ioboard_data));          memset(d, 0, sizeof(struct dec5500_ioboard_data));
177    
178          memory_device_register(mem, "dec5500_ioboard", baseaddr,          memory_device_register(mem, "dec5500_ioboard", baseaddr,

Legend:
Removed from v.41  
changed lines
  Added in v.42

  ViewVC Help
Powered by ViewVC 1.1.26