/[gxemul]/trunk/src/devices/dev_prep.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_prep.c

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

revision 21 by dpavlin, Mon Oct 8 16:19:23 2007 UTC revision 22 by dpavlin, Mon Oct 8 16:19:37 2007 UTC
# Line 1  Line 1 
1  /*  /*
2   *  Copyright (C) 2005  Anders Gavare.  All rights reserved.   *  Copyright (C) 2005-2006  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:
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *     *  
27   *   *
28   *  $Id: dev_prep.c,v 1.1 2005/11/21 09:17:26 debug Exp $   *  $Id: dev_prep.c,v 1.4 2006/02/09 20:02:59 debug Exp $
29   *   *
30   *  PReP interrupt controller.   *  PReP interrupt controller.
31   */   */
# Line 45  Line 45 
45  /*  /*
46   *  dev_prep_access():   *  dev_prep_access():
47   */   */
48  int dev_prep_access(struct cpu *cpu, struct memory *mem,  DEVICE_ACCESS(prep)
         uint64_t relative_addr, unsigned char *data, size_t len, int writeflag,  
         void *extra)  
49  {  {
50          /*  struct prep_data *d = extra;  */          /*  struct prep_data *d = extra;  */
51          uint64_t idata = 0, odata = 0;          uint64_t idata = 0, odata = 0;
# Line 55  int dev_prep_access(struct cpu *cpu, str Line 53  int dev_prep_access(struct cpu *cpu, str
53          if (writeflag == MEM_WRITE)          if (writeflag == MEM_WRITE)
54                  idata = memory_readmax64(cpu, data, len);                  idata = memory_readmax64(cpu, data, len);
55    
56          if (writeflag == MEM_READ)          if (writeflag == MEM_READ) {
57                  odata = cpu->machine->isa_pic_data.last_int;                  odata = cpu->machine->isa_pic_data.last_int;
58          else          } else {
59                  fatal("[ prep: write to interrupt register? ]\n");                  fatal("[ prep: write to interrupt register? ]\n");
60            }
61    
62          if (writeflag == MEM_READ)          if (writeflag == MEM_READ)
63                  memory_writemax64(cpu, data, len, odata);                  memory_writemax64(cpu, data, len, odata);
# Line 67  int dev_prep_access(struct cpu *cpu, str Line 66  int dev_prep_access(struct cpu *cpu, str
66  }  }
67    
68    
69  /*  DEVINIT(prep)
  *  devinit_prep():  
  */  
 int devinit_prep(struct devinit *devinit)  
70  {  {
71          struct prep_data *d;          struct prep_data *d;
72    
# Line 82  int devinit_prep(struct devinit *devinit Line 78  int devinit_prep(struct devinit *devinit
78          memset(d, 0, sizeof(struct prep_data));          memset(d, 0, sizeof(struct prep_data));
79    
80          memory_device_register(devinit->machine->memory, devinit->name,          memory_device_register(devinit->machine->memory, devinit->name,
81              0xbffffff0, 1, dev_prep_access, d, DM_DEFAULT, NULL);              0xbffff000, 0x1000, dev_prep_access, d, DM_DEFAULT, NULL);
82    
83          devinit->return_ptr = d;          devinit->return_ptr = d;
84    

Legend:
Removed from v.21  
changed lines
  Added in v.22

  ViewVC Help
Powered by ViewVC 1.1.26