/[dynamips]/trunk/dev_ram.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/dev_ram.c

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

upstream/dynamips-0.2.6-RC5/dev_ram.c revision 6 by dpavlin, Sat Oct 6 16:09:07 2007 UTC upstream/dynamips-0.2.7-RC1/dev_ram.c revision 7 by dpavlin, Sat Oct 6 16:23:47 2007 UTC
# Line 1  Line 1 
1  /*  /*
2   * Cisco C7200 (Predator) RAM emulation   * Cisco router simulation platform.
3   * Copyright (c) 2006 Christophe Fillot.  All rights reserved.   * Copyright (c) 2006 Christophe Fillot.  All rights reserved.
4     *
5     * RAM emulation.
6   */   */
7    
8  #include <stdio.h>  #include <stdio.h>
# Line 10  Line 12 
12  #include <errno.h>  #include <errno.h>
13  #include <unistd.h>  #include <unistd.h>
14    
15  #include "mips64.h"  #include "cpu.h"
16    #include "vm.h"
17  #include "dynamips.h"  #include "dynamips.h"
18  #include "memory.h"  #include "memory.h"
19  #include "device.h"  #include "device.h"
# Line 44  void dev_ram_shutdown(vm_instance_t *vm, Line 47  void dev_ram_shutdown(vm_instance_t *vm,
47    
48  /* Initialize a RAM zone */  /* Initialize a RAM zone */
49  int dev_ram_init(vm_instance_t *vm,char *name,int use_mmap,int delete_file,  int dev_ram_init(vm_instance_t *vm,char *name,int use_mmap,int delete_file,
50                   char *alternate_name,m_uint64_t paddr,m_uint32_t len)                   char *alternate_name,int sparse,
51                     m_uint64_t paddr,m_uint32_t len)
52  {  {
53     struct ram_data *d;     struct ram_data *d;
54    
# Line 74  int dev_ram_init(vm_instance_t *vm,char Line 78  int dev_ram_init(vm_instance_t *vm,char
78        }        }
79     }     }
80    
81     if (!(d->dev = dev_create_ram(vm,name,d->filename,paddr,len))) {     if (!(d->dev = dev_create_ram(vm,name,sparse,d->filename,paddr,len))) {
82        fprintf(stderr,"RAM: unable to create device.\n");        fprintf(stderr,"RAM: unable to create device.\n");
83        goto err_dev_create;        goto err_dev_create;
84     }     }
# Line 90  int dev_ram_init(vm_instance_t *vm,char Line 94  int dev_ram_init(vm_instance_t *vm,char
94  }  }
95    
96  /* Initialize a ghosted RAM zone */  /* Initialize a ghosted RAM zone */
97  int dev_ram_ghost_init(vm_instance_t *vm,char *name,char *filename,  int dev_ram_ghost_init(vm_instance_t *vm,char *name,int sparse,char *filename,
98                         m_uint64_t paddr,m_uint32_t len)                         m_uint64_t paddr,m_uint32_t len)
99  {  {
100     struct ram_data *d;     struct ram_data *d;
# Line 112  int dev_ram_ghost_init(vm_instance_t *vm Line 116  int dev_ram_ghost_init(vm_instance_t *vm
116     d->vm_obj.data = d;     d->vm_obj.data = d;
117     d->vm_obj.shutdown = (vm_shutdown_t)dev_ram_shutdown;     d->vm_obj.shutdown = (vm_shutdown_t)dev_ram_shutdown;
118    
119     if (!(d->dev = dev_create_ghost_ram(vm,name,d->filename,paddr,len))) {     if (!(d->dev = dev_create_ghost_ram(vm,name,sparse,d->filename,
120                                           paddr,len)))
121       {
122        fprintf(stderr,"RAM_ghost: unable to create device.\n");        fprintf(stderr,"RAM_ghost: unable to create device.\n");
123        goto err_dev_create;        goto err_dev_create;
124     }     }

Legend:
Removed from v.6  
changed lines
  Added in v.7

  ViewVC Help
Powered by ViewVC 1.1.26