/[qemu]/qemu/hw/mips_r4k.c
ViewVC logotype

Diff of /qemu/hw/mips_r4k.c

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

revision 1.11 by bellard, Wed Nov 23 21:11:49 2005 UTC revision 1.12 by bellard, Mon Dec 5 19:56:38 2005 UTC
# Line 53  static void cpu_mips_update_count (CPUSt Line 53  static void cpu_mips_update_count (CPUSt
53      next = now + muldiv64(compare - tmp, ticks_per_sec, 100 * 1000 * 1000);      next = now + muldiv64(compare - tmp, ticks_per_sec, 100 * 1000 * 1000);
54      if (next == now)      if (next == now)
55          next++;          next++;
56  #if 1  #if 0
57      if (logfile) {      if (logfile) {
58          fprintf(logfile, "%s: 0x%08llx %08x %08x => 0x%08llx\n",          fprintf(logfile, "%s: 0x%08llx %08x %08x => 0x%08llx\n",
59                  __func__, now, count, compare, next - now);                  __func__, now, count, compare, next - now);
# Line 84  static void mips_timer_cb (void *opaque) Line 84  static void mips_timer_cb (void *opaque)
84      CPUState *env;      CPUState *env;
85    
86      env = opaque;      env = opaque;
87  #if 1  #if 0
88      if (logfile) {      if (logfile) {
89          fprintf(logfile, "%s\n", __func__);          fprintf(logfile, "%s\n", __func__);
90      }      }
# Line 103  void cpu_mips_clock_init (CPUState *env) Line 103  void cpu_mips_clock_init (CPUState *env)
103    
104  static void io_writeb (void *opaque, target_phys_addr_t addr, uint32_t value)  static void io_writeb (void *opaque, target_phys_addr_t addr, uint32_t value)
105  {  {
106    #if 0
107      if (logfile)      if (logfile)
108          fprintf(logfile, "%s: addr %08x val %08x\n", __func__, addr, value);          fprintf(logfile, "%s: addr %08x val %08x\n", __func__, addr, value);
109    #endif
110      cpu_outb(NULL, addr & 0xffff, value);      cpu_outb(NULL, addr & 0xffff, value);
111  }  }
112    
113  static uint32_t io_readb (void *opaque, target_phys_addr_t addr)  static uint32_t io_readb (void *opaque, target_phys_addr_t addr)
114  {  {
115      uint32_t ret = cpu_inb(NULL, addr & 0xffff);      uint32_t ret = cpu_inb(NULL, addr & 0xffff);
116    #if 0
117      if (logfile)      if (logfile)
118          fprintf(logfile, "%s: addr %08x val %08x\n", __func__, addr, ret);          fprintf(logfile, "%s: addr %08x val %08x\n", __func__, addr, ret);
119    #endif
120      return ret;      return ret;
121  }  }
122    
123  static void io_writew (void *opaque, target_phys_addr_t addr, uint32_t value)  static void io_writew (void *opaque, target_phys_addr_t addr, uint32_t value)
124  {  {
125    #if 0
126      if (logfile)      if (logfile)
127          fprintf(logfile, "%s: addr %08x val %08x\n", __func__, addr, value);          fprintf(logfile, "%s: addr %08x val %08x\n", __func__, addr, value);
128    #endif
129  #ifdef TARGET_WORDS_BIGENDIAN  #ifdef TARGET_WORDS_BIGENDIAN
130      value = bswap16(value);      value = bswap16(value);
131  #endif  #endif
# Line 132  static uint32_t io_readw (void *opaque, Line 138  static uint32_t io_readw (void *opaque,
138  #ifdef TARGET_WORDS_BIGENDIAN  #ifdef TARGET_WORDS_BIGENDIAN
139      ret = bswap16(ret);      ret = bswap16(ret);
140  #endif  #endif
141    #if 0
142      if (logfile)      if (logfile)
143          fprintf(logfile, "%s: addr %08x val %08x\n", __func__, addr, ret);          fprintf(logfile, "%s: addr %08x val %08x\n", __func__, addr, ret);
144    #endif
145      return ret;      return ret;
146  }  }
147    
148  static void io_writel (void *opaque, target_phys_addr_t addr, uint32_t value)  static void io_writel (void *opaque, target_phys_addr_t addr, uint32_t value)
149  {  {
150    #if 0
151      if (logfile)      if (logfile)
152          fprintf(logfile, "%s: addr %08x val %08x\n", __func__, addr, value);          fprintf(logfile, "%s: addr %08x val %08x\n", __func__, addr, value);
153    #endif
154  #ifdef TARGET_WORDS_BIGENDIAN  #ifdef TARGET_WORDS_BIGENDIAN
155      value = bswap32(value);      value = bswap32(value);
156  #endif  #endif
# Line 154  static uint32_t io_readl (void *opaque, Line 164  static uint32_t io_readl (void *opaque,
164  #ifdef TARGET_WORDS_BIGENDIAN  #ifdef TARGET_WORDS_BIGENDIAN
165      ret = bswap32(ret);      ret = bswap32(ret);
166  #endif  #endif
167    #if 0
168      if (logfile)      if (logfile)
169          fprintf(logfile, "%s: addr %08x val %08x\n", __func__, addr, ret);          fprintf(logfile, "%s: addr %08x val %08x\n", __func__, addr, ret);
170    #endif
171      return ret;      return ret;
172  }  }
173    
# Line 233  void mips_r4k_init (int ram_size, int vg Line 245  void mips_r4k_init (int ram_size, int vg
245              initrd_size = 0;              initrd_size = 0;
246          }          }
247          env->PC = KERNEL_LOAD_ADDR;          env->PC = KERNEL_LOAD_ADDR;
248            /* Store command line.  */
249            strcpy (phys_ram_base + (16 << 20) - 256, kernel_cmdline);
250            /* FIXME: little endian support */
251            *(int *)(phys_ram_base + (16 << 20) - 260) = tswap32 (0x12345678);
252            *(int *)(phys_ram_base + (16 << 20) - 264) = tswap32 (ram_size);
253      } else {      } else {
254          kernel_base = 0;          kernel_base = 0;
255          kernel_size = 0;          kernel_size = 0;

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26