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

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

revision 4 by dpavlin, Mon Oct 8 16:18:00 2007 UTC revision 12 by dpavlin, Mon Oct 8 16:18:38 2007 UTC
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *     *  
27   *   *
28   *  $Id: dev_vr41xx.c,v 1.29 2005/04/09 12:11:46 debug Exp $   *  $Id: dev_vr41xx.c,v 1.30 2005/08/05 09:11:48 debug Exp $
29   *     *  
30   *  VR41xx (actually, VR4122 and VR4131) misc functions.   *  VR41xx (actually, VR4122 and VR4131) misc functions.
31   *   *
# Line 544  struct vr41xx_data *dev_vr41xx_init(stru Line 544  struct vr41xx_data *dev_vr41xx_init(stru
544          struct memory *mem, int cpumodel)          struct memory *mem, int cpumodel)
545  {  {
546          uint64_t baseaddr = 0;          uint64_t baseaddr = 0;
547            char tmps[100];
548          struct vr41xx_data *d = malloc(sizeof(struct vr41xx_data));          struct vr41xx_data *d = malloc(sizeof(struct vr41xx_data));
549    
550          if (d == NULL) {          if (d == NULL) {
551                  fprintf(stderr, "out of memory\n");                  fprintf(stderr, "out of memory\n");
552                  exit(1);                  exit(1);
# Line 587  struct vr41xx_data *dev_vr41xx_init(stru Line 589  struct vr41xx_data *dev_vr41xx_init(stru
589           *  which chips.           *  which chips.
590           */           */
591          if (cpumodel == 4131) {          if (cpumodel == 4131) {
592                  dev_ns16550_init(machine, mem, baseaddr + 0x800,                  snprintf(tmps, sizeof(tmps), "ns16550 irq=%i addr=0x%llx "
593                      8 + VRIP_INTR_SIU, 1, 1, "vr41xx siu");                      "name2=siu", 8+VRIP_INTR_SIU, (long long)(baseaddr+0x800));
594                    device_add(machine, tmps);
595          } else {          } else {
596                  /*  This is used by Linux and NetBSD:  */                  /*  This is used by Linux and NetBSD:  */
597                  dev_ns16550_init(machine, mem, 0xc000000,                  snprintf(tmps, sizeof(tmps), "ns16550 irq=%i addr=0x%x "
598                      8 + VRIP_INTR_SIU, 1, 1, "vr41xx serial");                      "name2=serial", 8+VRIP_INTR_SIU, 0xc000000);
599                    device_add(machine, tmps);
600          }          }
601    
602          /*  Hm... maybe this should not be here.  TODO  */          /*  Hm... maybe this should not be here.  TODO  */

Legend:
Removed from v.4  
changed lines
  Added in v.12

  ViewVC Help
Powered by ViewVC 1.1.26