3 * emul_netbsd.c (do_read): Correctly set the return value.
10 (do_sigprocmask): Ditto.
13 (do_gettimeofday): Ditto.
14 (do_getrusage): Ditto.
22 * device_table.c (vm_ioctl_callback): Don't access the processor
23 registers directly, instead leave it to the caller to handle this.
25 * emul_netbsd.c (do_break): Which calls vm_ioctl_callback to
26 perform a break. Pass in the new break value and set the
27 registers according to the result.
29 * emul_generic.c (emul_write_status): Change so that r3 contains
30 either status or errno and failure is indicated by SO.
34 * emul_bugapi.c (emul_bugapi_create): More strict check of OEA
39 * INSTALL: Fix some long lines and remove x86 specific options in
44 * INSTALL: Update to reflect gdb-4.16.
46 * RUN: Update to reflect gdb-4.16. Review notes on building a BSD
51 * emul_bugapi.c (_os_emul_data): Add fields for output, input.
52 (emul_bugapi_create): Create input, output from /chosen/stdin and
54 (emul_bugapi_do_{read,write}): Switch to use device_instance
56 (emul_bugapi_instruction_call): Change calls to
57 emul_bugapi_do_{read,write} to pass device instance argument.
61 * igen.c (idecode_switch_end): Fix 2/26 change so that an extra
62 default is not written out if a default was already written.
64 * psim.c (psim_{read,write}_register): Use sizeof unsigned_8 to
65 size cooked_buf, not sizeof natural_word, since floating point
66 registers are 8 bytes.
70 * main.c (error): Be careful to not try to print out statistics
71 when the simulation was never created.
75 * emul_netbsd.c: Only include sys/mount.h if HAVE_SYS_MOUNT_H is
77 * configure.in: Test for sys/mount.h.
78 * configure,config.in: Regenerate.
82 * Makefile.in (corefile.o): missing dependency on device_table.h
87 * igen.c (idecode_switch_end): Output a default entry when the
88 switch statement is perfect. Firstly stops GCC complaining about
89 an incomplete switch and secondly it will be eliminated by a good
94 * README, RUN, INSTALL: Update to reflect announcement
95 * psim: PSIM 1.0.1 released
99 * emul_bugapi.c (emul_bugapi_do_read): New function to handle
101 (emul_bugapi_instruction_call): Add support for .INCHR/.INLN
104 * emul_bugapi.c (emul_bugapi_do_write): Call flush_stdoutput.
105 * emul_netbsd.c (do_write): Call flush_stdoutput.
107 * main.c (flush_stdoutput): Do fflush (stdout).
108 * sim_calls.c (flush_stdoutput): Do gdb_flush (gdb_stdout);
109 * sim_callbacks.h (flush_stdoutput): Declare.
113 * emul_bugapi.c (bug_mapping): New structure to map bug system
114 call numbers to a string.
115 (toplevel): Add remaining bugapi system calls.
116 (emul_bugapi_instruction_name): Map bugapi system call number to a
118 (emul_bugapi_do_write): Common code to process write system calls.
119 (emul_bugapi_instruction_call): If os-emul tracing is on, trace
120 the system call. Use the name to print unknown system call.
121 Correct implementation of _OUTLN. Add support for _OUTSTR and
126 * NOTES: New file. Ramblings on why things were done they way
129 * psim.c (psim_options): Didn't enter the model value into the
130 device tree as a string.
132 * cpu.c (cpu_synchronize_context): Wrong test for conditional
135 * emul_generic.c (emul_add_tree_hardware): reg value didn't match
138 * ppc-opcode-flat: new file. Generate an instruction decode
139 function like ppc-opcode-complex but use switch statements.
141 * INSTALL: document new opcode file, add example configurations.
145 * main.c (main): rename psim instance (system) to simulation and
147 * main.c (error): print out performance even when an error occures.
149 * emul_bugapi.c (emul_bugapi_create): Fix argument passing.
151 * emul_generic.c (emul_add_tree_hardware): Move hardware devices
152 to 0x80000000 from 0x400000.
156 * config.in (HAVE_DIRENT_H): Temp until config.in regenerated.
160 * ppc-instructions (TLB Invalidate Entry, TLB Invalidate ALL):
161 Implement by passing on request to all processors.
162 * ppc-instructions (TLB Synchronize): Implement as empty, processor
163 tlb's are always in sync.
165 * cpu.c (cpu_page_tlb_invalidate_all): New function. Pass on TLB
166 invalidate request to processors VM sub-system.
167 * cpu.c (cpu_page_tlb_invalidate_entry): Ditto.
169 * vm.c (vm_page_tlb_invalidate_all): New function. Mark all page
170 TLB entries as invalid.
171 * vm.c (vm_page_tlb_invalidate_entry): New function. Ditt but only
172 invalidate one TLB entry.
174 * psim.c (psim_init): Invalidate TLB's before (re)starting.
178 * emul_generic.c (emul_add_tree_options): Add argument
179 oea_interrupt_prefix (0 or 1) that specifies the prefix MSR[IP]
180 and hence the location of the interrupt vectors. Add this to the
183 * emul_chirp.c (emul_chirp_create): Allow configuration of
184 floating-point and interrupt prefix (default 0) using the above.
186 * emul_netbsd.c (emul_netbsd_create): Pass dummy arg for
189 * emul_bugapi.c (emul_bugapi_create): Allow configuration of
190 interrupt prefix (default 1) and configure interrupt table traps
193 * emul_generic.c (emul_add_tree_hardware): Include a small eeprom
194 in the list of devices.
196 * device_table.c: For moment fake eeprom device by a memory
197 device. In future will need a proper eeprom device.
201 * psim.c: Include options.h so print_options is declared.
205 * emul_netbsd.c (toplevel): Do not include sys/resource.h if the
206 system doesn't have it, and turn off getrusage processing.
207 (write_rusage): #ifdef out if we don't have getrusage.
208 (do_getrusage): Define as 0 if we don't have getrusage.
212 * configure.in (AC_HEADER_DIRENT): Add, so that we can figure out
213 where the directory functions are declared.
214 * configure: Regenerate
216 * emul_netbsd.c: Use the macros defined by configure to find the
217 appropriate directory functions.
221 * psim: PSIM-1.0 released
225 * configure.in (xor_endian): Trace setting of xor-endian flag.
229 * psim.c (psim_usage): Extend documentation.
231 * ppc-instructions (model-print): fix typo.
235 * configure.in (with-smp): Default configuration allow up to
236 five processors (but enable only one).
238 * emul_bugapi.c (emul_bugapi_create): If floating-point is
239 allowed, enable the floating point instruction set in the
244 * emul_chirp.c (chirp_emul_seek, chirp_emul_read,
245 chirp_emul_write): Tolerate invalid ihandles.
247 * device.c (device_instance_create, device_instance_delete):
248 init/delete instance name
250 * emul_chirp.c (emul_chirp_instruction_call): Read the nr args and
251 returns when determining the service.
253 * emul_chirp.c (chirp_read_t2h_args): Allow variable number of
254 args for the method "call-method".
256 * emul_chirp.c (chirp_emul_getprop): Tolerate a n_returns of zero
257 - should be one. Some OpenBoot code doesn't pass correct arg.
259 * emul_chirp.c (chirp_emul_getprop): Trace more property types.
263 * RUN: New file. Describe how to run PSIM
264 * INSTALL: New file. Describe how to install PSIM
265 * README: New file. Overview PSIM.
266 * BUGS: New file. Briefly discuss bugs and limitations
270 * emul_bugapi.c (OEA_START_ADDRESS): Put it back to 0x100000,
271 wasn't correctly using GLD.
275 * emul_generic.c (emul_add_tree_options): Make default number of
276 active processors 1 (even when SMP enabled).
280 * device_table.c (icu_io_read_buffer_callback): Add extra register
281 (at addr + 4) that returns number of processors.
283 * emul_generic.c (emul_add_tree_hardware): Update device node to
288 * emul_bugapi.c (OEA_START_ADDRESS): Change to 0x4000 so that it
289 matches gas-960116/ld.
293 * psim-960119 released - psim-1.0b01.
297 * psim.c (psim_create): Re-order so that all options are set
298 before the CPU's are created. Was breaking mon_create();
300 * psim.c (psim_create): Tidy up conflicting configuration errors.
302 * * (*): Adjust copyleft as required.
304 * debug.c: Add missing print-info entry to trace table.
306 * os_emul.c (os_emul_create): Fix `-e' option. Was looking under
309 * psim.c (psim_options): Fix `-r' option. Was entering under wrong
314 * vm.c (om_unpack_bats): Fix checking of bat bits.
316 * emul_chirp.c (emul_chirp_create): Store address of OB in memory
317 in the os_emul_data structure.
319 * emul_bugapi.c (emul_bugapi_create): Store the address of the
320 bugapi code (in main memory) in the os_emul_data structure.
324 * vm.c (om_translate_effective_to_real): Fix trace output.
328 * device_table.c (generic_device_init_address): Create memory from
329 information obtained from `reg' property.
330 * device_table.c (vm_init_address_callback): Use information
331 obtained from properties.
332 * emul_netbsd.c (emul_netbsd_create): Update to create device and
333 property entries to match
337 * idecode_expression.h (ALU_END): Add ITRACE of the result.
339 * ppc-instructions (Equivalent): Enable this instruction.
340 (Add to Minus One Extended): Ditto.
341 (Subtract from Minus One Extended): Ditto.
342 (Add/And/Or/Xor Immediate): Add alu trace of result.
343 (Add/And/Or/Xor Shifted Immediate): Ditto.
344 (And/Or/Equivalent/Nand/Nor): Ditto.
345 (And/Or with Complement): Ditto.
346 (Extend Sign Byte/Half Word): Ditto.
347 (Count Leading Zeros): Ditto.
348 (Shift Right Algerbraic Word): Ditto.
349 (Shift Right Algerbraic Word Immediate): Ditto.
353 * device.c (device_init_address): New. Split initialization into
354 two stages, address and address spaces
355 * device.c (device_init_data): New. ... and data or other work.
356 With out this, devices try to modify memory before it as been
359 * device.c (device_tree_init): Update to perform staged
362 * device.c (device_init): Delete.
366 * device_table.c (data_*): Rewrite to make heaver use of property
367 nodes. Allow initialization by different data types.
368 * device_table.c (htab_* pte_*): Rewrite to use properties.
370 * emul_chirp.c (emul_chirp_create): Use
371 * emul_bugapi.c (emul_bugapi_create): Ditto
372 * emul_netbsd.c (emul_netbsd_create): Ditto
376 * emul_generic.c (emul_add_tree_options): Annotate existing tree
377 with options that haven't yet been specified.
378 * emul_generic.c (emul_add_tree_hardware): Annotate existing tree
379 with demo devices and properties.
381 * emul_chirp.c (emul_chirp_create): Update to use new
382 device_tree_add_parsed call and additional information now
383 included in the device tree. Use emul_add_tree* functions to add
385 * emul_bugapi.c (emul_bugapi_create): Ditto
386 * emul_netbsd.c (emul_netbsd_create): Ditto
390 * device.c (device_instance_create): New. Create/delete and
391 operate on instances of a device.
392 * device.c (device_instance_delete): Ditto
393 * device.c (device_instance_read): Ditto
394 * device.c (device_instance_write): Ditto
395 * device.c (device_instance_seek): Ditto
396 * device.c (device_instance_data): Ditto
397 * device.c (device_instance_name): Ditto
398 * device.c (device_instance_path): Ditto
400 * emul_chirp.c (chirp_emul_open): Implement using device_instance.
401 * emul_chirp.c (chirp_emul_close): Ditto
402 * emul_chirp.c (chirp_emul_read): Ditto
403 * emul_chirp.c (chirp_emul_write): Ditto
404 * emul_chirp.c (chirp_emul_seek): Ditto
406 * emul_chirp.c (chirp_read_t2h_args): Read arguments from device.
407 Being careful to convert all from target to host byte order.
408 * emul_chirp.c (chirp_write_h2t_args): Converse.
412 * device.c (device_tree_add_parsed): New. Rewrite code to add
413 devices to the device tree so that a single printf style function
416 * device.c (device_tree_add_*): Delete. Replaced by above.
418 * device.c (split_device_specifier): Functions to manipulate a
419 device specifier (path) breaking it into its components
420 * device.c (split_property_specifier): Ditto
421 * device.c (split_device_name): Ditto
422 * device.c (split_find_device): Ditto
424 * device.c (scan_*): Delete
426 * device.c (device_tree_find_device): Rewrite to use above.
427 * device.c (device_add_property): Ditto
431 * psim.c(psim_options): Parse the psim options, installing their
432 value in the device tree. Options are now first entered into a
433 device tree and then extracted out again when needed. This allows
434 greater flexability in configuration.
436 * psim.c (psim_tree): Returns a basic device tree ready for
437 parsing by psim_options.
438 * psim.c (psim_usage): New. Give usage to varing levels of detail
439 according to the verbosity. In turn output device and trace
442 * main.c (main): Update to use new system
443 * sim_calls.c (sim_open, sim_do_command): Ditto
445 * psim.c (psim_options): Add `r' option - ram size.
446 * psim.c (psim_options): Add `o' option - openboot tree entry.
447 * psim.c (psim_options): Add `h'/`H' options - more help.
449 * debug.c (trace_usage): Add more detailed help.
450 * device.c (device_usage): New. Output help including a list of
451 the devices currently available in the device table.
452 * device_table.c: Add usage operator to each device.
454 * corefile.c (core_create, core_device_create): Adjust so that the
455 core device is created earlier for psim_tree(). Core can later be
458 * psim.c (psim_create): Update to handle above way of creating
459 things. Extract all information from the device tree.
461 * device_tree.c (trace_*): New device node, its properties are
462 used to set the value of the trace options. Init this device (in
463 psim_options) when ever the options are updated.
467 * debug.h: Add trace_print_info, trace_print_device_tree and
468 trace_dump_device_tree. The first is a replacement for the
469 variable `print_info' found in main.c and sim_calls.c. The latter
470 two enable the dumping of the entire device tree.
472 * debug.c: Add to trace_description table.
474 * main.c (main): Use above trace instead of local variable
475 * sim_calls.c (sim_close): Ditto
477 * device.c (device_tree_print_device): New. Prints the device
478 tree in a format that is consistent with what can be parsed by the
479 device tree load from file code.
481 * psim.c (psim_create): Dump device tree if enabled. If nump
482 selected, exit psim immediatly.
486 * corefile-n.h (core_map_read_N): When mapping from an address to
487 a device, do not subtract the devices base. The device its self
488 can do this. Brings the behavour into line with OpenBoot.
489 * corefile-n.h (core_map_write_N): Ditto
490 * corefile.c (core_map_read_buffer): Ditto
491 * corefile.c (core_map_write_buffer): Ditto
493 * device_table.c (console_io_read_buffer_callback): Adjust to
494 handle biased address.
495 * device_table.c (console_io_write_buffer_callback): Ditto
499 * device.c (attach_device_interrupt_edge): New. Interrupt model
500 did not allow interrupts to be wired up as a general net (edges).
501 Re-implement so that interrupt events can be passed to multiple
502 controllers and interrupt controllers can further propogate
505 * device.c (attach_device_interrupt_edge) : New, Ditto
506 * device.c (detach_device_interrupt_edge) : New, Ditto
507 * device.c (clean_device_interrupt_edges) : New, Ditto
508 * device.c (device_interrupt_event) : New, Ditto
509 * device.c (device_interrupt_attach) : New, Ditto
510 * device.c (device_interrupt_detach) : New, Ditto
511 * device.c (device_child_interrupt_attach) : New, Ditto
512 * device.c (device_child_interrupt_detach) : New, Ditto
514 * device.c (device_attach_interrupt) : Delete old
515 * device.c (device_detach_interrupt) : Delete old
516 * device.c (device_interrupt) : Delete old
517 * device.c (device_interrupt_ack) : Delete old
519 * device_table.c (unimp_*) : Update to match
521 * device_table.c (icu_io_write_buffer_callback) : Update to use
523 * device_table.c (icu_interrupt_event_callback) : Ditto
527 * device.c (external_to_device) : New function that provides a
528 standard mapping between a devices internal representation (a
529 pointer) and its external (or what is passed to a client)
530 representation (a phandle). Implement using the cap object
531 attached to the root node.
533 * device.c (device_to_external) : Ditto
534 * device.c (external_to_device_instance) : Ditto but for ihandle
536 * device.c (device_instance_to_external) : Ditto
538 * Makefile (device.o): Add dependency on cap.
540 * emul_chirp.c (struct _emul_chirp_data) : Elimate use of cap. Code
541 needing to translate between internal and external representations
542 changed to use the external_to_device et.al. device operations.
543 * emul_chirp.c (chirp_emul_*) : Ditto
545 * Makefile (emul_chirp.o): Remove dependency on cap
549 * emul_bugapi.c (emul_bugapi_instruction_call) : Make format type
551 * emul_chirp.c (map_over_chirp_note) : Ditto
552 * emul_chirp.c (chirp_emul_test) : Ditto
553 * device_table.c (register_init): Ditto
557 * configure.in: Make disable-sim-switch default. Switch only
558 useful if using --enable-sim-opcode=ppc-opcode-stupid and then
563 * device_table.c (register_init): Make format type correct.
567 * emul_chirp.c (map_over_chirp_note): Tighten up (and fix) checks
568 on OpenBoot note section.
572 * emul_generic.c (emul_write_buffer): Use vm faulting byte
573 read/write calls for buffer transfers. This will cause a fault to
574 occure if the transfer fails. CHRP catches the fault while the
575 others suffer the consequences.
576 (emul_read_buffer): Ditto.
577 (emul_write_word): Ditto.
578 (emul_read_word): Ditto.
579 (emul_read_string): Ditto.
583 * emul_chirp.c (emul_chirp_create, emul_chirp_instruction_call),
584 emul_generic (emul_blr_instruction): Use a real blr instruction to
585 return from a client service call.
587 * emul_chirp.c (services): Add all OpenBoot services to table.
589 * emul_generic.h, emul_bugapi.c (emul_bugapi_create), emul_chirp.c
590 (emul_chirp_create) : Use names instead of numbers for
591 instructions being stored in memory.
595 * Makefile.in (maintainer-clean): Remove .log, core and *.core
600 * emul_bugapi.c (emul_bugapi_create): Add nodes to init the
601 system-call trap to the emul instruction call instruction (Along
602 with an rfi and infinate loop).
604 * emul_bugapi.c (emul_bugapi_instruction_call): Expand to include
605 a few real PPC bug calls. Test with simple hello world.
609 * device.h, device.c (device_child, device_sibling): New
610 functions. Return corresponding device value.
612 * emul_chirp.c (chirp_emul_child, chirp_emul_peer,
613 chirp_emul_parent): New functions - emulate corresponding OpenBoot
616 * device_table.c (register_init): Extend properties attached to
617 register init node to allow a specific processor's register to be
620 * emul_chirp.c (emul_chirp_create): Init SMP correctly - the
621 initial PC for all processors is an infinate loop but then, for
622 processor zero, is quickly changed to be the correct code starting
625 * emul_chirp.c (emul_chirp_create): Add fake bootpath
626 et.al. properties to tree.
628 * emul_chirp.c (chirp_emul_getproplen): New function. Emulate the
629 getproplen OpenBoot call.
631 * emul_chirp.c (emul_chirp_instruction_call): Document other
632 possible chirp emulation internal states.
634 * emul_chirp.c (emul_chirp_instruction_call): Trace failed lookups
635 as well as successful ones.
637 * emul_chirp.c (emul_chirp_open): New function - handle open
640 * Makefile.in (maintainer-clean): Proper rule that eliminates more
645 * emul_chirp.c (chirp_emul_exit): Full out call.
647 * device_table.c (htab_map_page): Wasn't handling byte swap when
648 creating entries in the hash table.
650 * device.c (device_tree_find_node): Allow primative wild-card match
651 of device names with the path.
655 * emul_chrp.c (chirp_emul_write, chirp_emul_finddevice): add
658 * emul_chrp.c: Change return type of emul functions to int. Emul
659 functions either return -1 or zero so unsigned was a bit
662 * inline.h (*), igen.c, dgen.c, *: Update INLINE macros so that
663 they are paramaterised with the type of the function. Gets around
664 the problem of `static' needing to come first with `attribute'
665 comming last. Format declarations and definitions so that emacs
666 doesn't get confused.
670 * std-config.h (PSIM_INLINE): Add missing inline configuration
671 control for the main loop.
673 * mon.c (mon_print_info): If monitoring disabled still print out
674 the number seconds used.
676 * psim.c (run_until_stop): Don't monitor the cache misses when
677 monitoring is disabled.
679 * configure.in (sim_mon, sim_monitor): Correct typo - sim_mon ->
680 sim_monitor for shell variable (or should that have been the other
683 * vm.c (vm_synchronize_context): Fix wrong test for unsuported
684 change in endian-mode.
686 * std-config.h (WITH_REGPARM), inline.h (IDECODE_INLINE,
687 SEMANTICS_INLINE): Add -DWITH_REGPARM=<n> option. Enables the
688 __attribute__((__regparm(WITH_REGPARM))) for some functions.
689 configure with --enable-sim-cflags="-DWITH_REGPARAM=3" (say).
690 Unfortunatly it tickles a bug (gcc?) and can't be used.
696 * device.c (device_tree_add_device): Make trace fprintf arguments
698 * device_table.c (htab_decode_hash_table): Ditto.
699 (htab_map_binary): Ditto.
700 (htab_init_callback): Ditto.
701 * vm.c (om_virtual_to_real): Ditto.
705 * emul_netbsd.c (emul_netbsd_create): Deal with new BFD that
706 changed how big/little endian support is recorded, while remaining
707 compatible with the old BFD with #ifdefs.
708 * emul_chirp.c (emul_chirp_create): Ditto.
709 * emul_bugapi.c (emul_bugapi_create): Ditto.
713 * std-config.h (MODEL_INLINE): Turn off INLINE_MODULE by default.
715 * corefile.h: Delete declarations for unknown functions.
717 * interrupts.h: Ditto.
718 * interrupts.c: Ditto.
720 Thu Dec 14 18:49:34 1995 Andrew Cagney <cagney@sawnoff>
722 * lf.c (lf_print_function_type): New function. Munges a function
723 type so that the prefix (eg INLINE...) is inserted after the type
726 * igen.c: Change to output functions using this.
730 * options.c (options_inline): Function to output meaningful
731 description of the INLINE options.
733 * configure.in (inline): Replace inline magic numbers with macro
734 names. Map 1->LOCALS_INLINE and 2->ALL_INLINE.
736 * inline.h, inline.c: update to use inline method.
738 * std-config.h (CPU_INLINE), cpu.h, inline.h, inline.c: make cpu.h
741 * std-config.h (EVENTS_INLINE): Inline events in psim.
745 * device_table.c (htab_sum_binary): DMA binaries to correct byte
750 * psim.c (psim_merge_device_file): Change `=' to `==', was this an
753 Tue Dec 5 11:56:14 1995 Andrew Cagney <cagney@sawnoff>
755 * ppc-instructions (ppc_nr_mtcrf_crs, ppc_branch_conditional_name,
756 ppc_function_unit_name): Simplify by declaring these arrays as
757 pure and simple static (instead of STATIC_MODEL).
761 * sim_calls.c (sim_create, sim_load), main.c (main), psim.c: Pass
762 an options device into psim_create() so that options can be merged
765 * device.c (*add*): Change semantics so the add functions only add
766 when the new device (or property) doesn't already exist. This
767 allows merging of options and data.
769 Mon Dec 4 17:12:13 1995 Andrew Cagney <cagney@sawnoff>
771 * Makefile.in (BASICS_H): Didn't include basics.h in the list of
772 header files to depend on.
774 Mon Dec 4 17:12:13 1995 Andrew Cagney <cagney@sawnoff>
776 * std-config.h: (*_MODULE): Extend the <module>_inline macro's so
777 that they also allow control over static functions. Rewrite
778 document to reflect this.
780 * std-config.h: (INLINE): Simplify definition, the above and
781 earlier changes to igen.h eliminate the need to be defensive about
782 enabling the inline of static functions.
784 * std-config.h: (SIM_ENDIAN_INLINE, BITS_INLINE): Document limited
785 suport for inlineing of modules for all callers. Adjust relevant
786 macro's so that DEFAULT_INLINE will enable this.
788 * basics.h: Re-order #includes and definitions so that c-code for
789 basic include files does not call functions delcared in later
792 * basics.h (__attribute__), sim_callbacks.h: Move attribute macro
793 to basics.h and add hack (include <stdio.h>) to try and bring that
794 and other possible conflicting macros into scope much earler.
796 * sim-endian.h,c (SIM_ENDIAN_INLINE) bits.h,c (BITS_INLINE):
797 Change to use the updated inline definitions. If enabled
798 immediatly include the corresponding c-code so that it will inline
801 * inline.h, inline.c (SIM_ENDIAN_INLINE, BITS_INLINE): Remove
802 these cases, moved to module specific header files.
806 * vm.c, vm_n.c: Fix htab code.
808 * vm.c (vm_data_map_read_buffer): Was using EA not RA when reading
811 * device.c: Fix htab create code.
815 * bits.h, bits.c (EXTRACTED): Convert to function, fix - had &&
818 * sim-endian.h (SWAP_N), sim-endian-n.h, sim-endian.c: How
819 embarasing - fix yet another bug in the swap code! Simplify
820 everything by using more functions. Add host to big-endian byte
825 * devices.h, devices.c: delete, replaced by the files
826 device_table.[ch] and device.[ch].
827 * device_tree.h, device_tree.c: ditto
829 * device_table.h, device_table.c: New files. Contain a table of
832 * device.h, device.c, Makefile.in, std-config.h (DEVICE_INLINE),
833 options.c (print_options): New files. Define the device object
834 along with any attached properties.
836 * device_tree.h, device_tree.c: Update to use new device object.
837 For convenience, change the printd functions into device_tree_add
840 * psim.c (create_*_tree): Use new device_tree create functions.
842 * corefile.h, corefile.c corefile-n.h (core_n.h): Update to use
843 the new device.h / device_table.h interface. Rename core_n.h to
844 corefile-n.h to be consistent with other n files.
846 * Makefile.in (run): add corefile-n.h to dependencies for
849 * basics.h (device_instance), device.h, device.c, device_table.h,
850 device_table.c: Add the concept of a device instance and operators
851 on these instances - corresponds to ihandle in OpenBoot speak.
852 Don't yet implement it.
854 Tue Nov 14 12:27:08 1995 Andrew Cagney <cagney@sawnoff>
856 * emul_generic.h, emul_generic.c (emul_syscall_enter,
857 emul_syscall_exit): rename from emul_enter_call /
858 emul_exit_call. As only used by emul_do_system_call simplify
861 * os_emul.h, os_emul.c, emul_generic.h: Correct and fill an
864 * os_emul.c, emul_bugapi.h, emul_bugapi.c, Makefile.in: Add
865 preliminary hooks for a kernel mode rom emulation.
867 * cap.h (new), cap.c (new): Capability data base. Some emulations
868 pass object identifiers (capabilities?) to/from the simulated code
869 (for instance the phandle in OpenBoot). The cap object is able to
870 check/map between internal and external (target program)
871 representations of each identifier.
873 * os_emul.c, emul_chirp.h, emul_chirp.c, Makefile.in: Add
874 preliminary hooks for a kernel mode IEEE-1275 emulation.
876 * cpu.h, cpu.c (cpu_create, cpu_os_emulation, cpu): Add os_emul to
877 list of arguments passed in when creating a cpu. Grant access to
880 * std-config.h (OS_EMUL_INLINE), options.c (print_options),
881 inline.h, inline.c: New to allow control over inline of
882 corresponding code files.
884 * ppc-instructions (instruction_call): Add illegal instruction to
885 call the instruction-call emulation handler.
887 * interrupts.c (system_call_interrupt): Call renamed
888 os_emul_system_call function().
890 * emul_netbsd.c: Update to interface to generic emulation. Since
891 all its functions are called via a table don't worry about any
894 * emul_generic.h, emul_generic.c, spa-*(delete): Remove references
895 and code for spa, no longer to be used.
897 * psim.c (create_chirp_device_tree): Fill out what was previously
898 the openboot create function so that it starts to create a full
899 OpenBoot device tree.
903 * debug.h, debug.c: pte trace is made redundant by htab trace,
904 delete it. Add vm to list of options. Simplify tracing output so
905 lines are not as long.
909 * events.h, events.c (event_queue_init), psim.c (psim_init): (re)
910 initialize the event queue.
919 * sim-endian.h: Look at WORDS_BIGENDIAN to determine if the host
920 is big endian or little endian. For SWAP_n, use htonl/htons if
921 host is little endian, not big endian and if WITH_NTOH is defined.
923 * configure{,.in} (--enable-sim-model-issue): Instead of defining
924 0/1, define it to be MODEL_ISSUE_{PROCESS,IGNORE}. Add
925 AC_C_BIGENDIAN to determine if the host is big endian or not.
926 * config.in: Regenerate.
928 * std-config.h (WITH_MODEL_ISSUE): Default to 0.
929 (CURRENT_MODEL_ISSUE): Reference WITH_MODEL_ISSUE, and if that is
930 0, use current_model_issue.
931 (MODEL_ISSUE_{PROCESS,IGNORE}): Define as -1/1.
933 * psim.c (current_model_issue): New global variable.
935 * cpu.c (cpu_create): Use CURRENT_MODEL_ISSUE > 0 instead of
937 (cpu_{init,halt}): Ditto.
938 * mon.c (mon_print_info): Ditto.
939 * ppc-instructions (PPC_INSN_* macros, branch handling): Ditto.
941 * mon.c (mon_print_info): Print instructions/second if verbose > 0,
944 * main.c (main): Set current_model_issue to MODEL_ISSUE_PROCESS if
945 the -I switch is used.
946 * sim_calls (sim_open): Ditto.
948 * ppc-instructions (model support): Add support for determining
949 when we don't have enough writeback slots. Add tracing for the
950 beginning of each cycle.
954 * mon.c: Check for whether to include sys/types.h and sys/time.h.
956 * configure.in: Check for include files sys/types.h and
958 * configure: Regenerate.
959 * config.in: Regenerate.
961 * cpu.h (CONST_ATTRIBUTE): Define as __attribute__((__const__)) if
963 (cpu_system): Use CONST_ATTRIBUTE, so that when we're not inlining
964 the world, the optimizer has a fair chance of CSE'ing function
966 (cpu_{monitor,nr,registers,model}): Ditto.
968 * std-config.h (MODEL_INLINE): If not defined, define as 1 if
969 DEFAULT_INLINE is non-zero, 0 otherwise, rather than just the
970 value of DEFAULT_INLINE.
974 * lf.h (__attribute__): If not GCC and at least 2.7.0, define as
976 (lf_printf): Add printf __attribute__, so the compiler will
977 automatically check the format string.
979 * configure{,.in} (--enable-sim-icache): If argument is define,
980 add -R to flags passed to igen.
982 * igen.c (stdlib.h): Include if the system supplies one.
983 (semantics_use_cache_struct): New global for -R flag to say
984 semantics is to use the cache structure directly rather than
985 putting the values into local variables.
986 (first_undef, last_undef): New structures to remember names to
988 (lf_print_c_extraction): If -R and this is semantics, emit names
989 as #defines pointing to the cache structure, rather than loading
990 the values into local variables.
991 (lf_print_c_semantic_function): If -R, #undef all of the names
992 defined in lf_print_c_extraction.
993 (main): Recognize -R.
995 * idecode_fields.h (SPR_*): Redefine spr_* macros as SPR_* to
996 avoid a name confict if -R passed to igen.
998 * ppc-instructions (mfspr, mtspr): Rename spr field to SPR.
999 (model_data): Add field to count the various # of CRs that the
1000 mtcrf instruction used.
1001 (model_mon_info): Return structures counting the # of CRs that the
1002 mtcrf instruction used.
1003 (branches, sync instructions): Do not call model functions if
1004 WITH_MODEL_ISSUE is 0.
1006 * mon.c (stdlib.h): Include if the system supplies one.
1007 (mon_sort_instruction_names): New function to sort instruction
1008 names alphabetically.
1009 (mon_print_info): Call qsort with mon_sort_instruction_names to
1010 sort instruction names. Don't abort if WITH_MODEL_ISSUE is 0.
1012 * debug.h (ITRACE): Make printf_filtered arguments type correct.
1013 * idecode_expression.h (CR0_COMPARE): Ditto.
1014 * psim.c (psim_read_register): Ditto.
1016 * igen.c (lf_print_my_prefix): Use __attribute__((__unused__)) to
1017 silence compiler warnings about unused automatically generated
1019 (lf_print_c_extraction): Ditto.
1020 * idecode_expression.h (FPSCR_BEGIN): Ditto.
1022 * ppc-cache-rules: Define rules for making a bitmask for all
1025 * ppc-instructions: Rewrite model specific functions to use the
1026 bitmask of the register number, instead of using the register
1027 pointer to get the register number, and then making the bitmask.
1031 * ppc-instructions (model_branches): Add conditional argument to
1032 count the number of times each type of conditional branch is used.
1033 (conditional branches): Pass B0 or -1 to model_branches.
1034 (model_mon_info): Print out conditional branch counts.
1035 (model-data): Add support for printing out conditional branch
1040 * igen.c (insn_table_load_insns): Add support for model-static for
1041 internal functions that should not be inlined.
1042 (lf_print_c_semantic): Remove model_cleanup.
1043 (gen_model_{c,h}): Ditto.
1045 * ppc-instructions: Redo model specific support once again. Add
1046 floating point support to the model specific information. Flesh
1047 out all of the floating mutiply add/subtract instructions. Add
1048 better tracing support to the model specific information.
1052 * ppc-instructions (model data, model_busy): Rather than using a
1053 bit mask for the busy units, just use a char array. Also, only
1054 support 2 function units an insn can use, rather than a loop.
1058 * table.c (table_entry_read): Move setting entry->line_nr to after
1059 the model specific fields so the line numbers for the annex are
1062 * cpu.c (cpu_{create,init,halt}): Check for WITH_MODEL_ISSUE
1063 before calling the model functions.
1065 * debug.c (trace_descriptor): Add trace_model support.
1066 * debug.h (trace_options): Ditto.
1068 * igen.c (gen_icache_h): Create type idecode_cache as void if not
1069 caching instructions.
1070 (gen_model_{c,h}): Drop model_issue support. Add support for
1072 (lf_print_my_prefix): Initialize a const itable_index with the
1074 (lf_print_c_semantic): Call model_cleanup at the end of the
1075 function to check for instructions that aren't supported yet by
1076 the scheduling code.
1078 * mon.h (count_type): New type for counters.
1079 * mon.c: Use count_type instead of unsigned.
1081 * ppc-instructions: Redo scheduling code once again. Make it all
1082 inline friendly. Instead of having general code emitted by igen,
1083 go the route of having each semantic routine call the appropriate
1088 * table.c (table_entry_read): Allow the annex to have blank lines.
1090 * ppc-instructions: Change lines in model stuff that just have a
1091 tab to just newline. Add 601 support. Document most instructions
1092 in terms of model specific timing information. Drop 'FUNCTION'
1093 from PPC_FUNCTION_UNIT_xxx enums. Change PPC_UNIT_UNKNOWN ->
1094 PPC_UNIT_BAD. Add TRACE(trace_tbd) for all data cache
1095 instruction.s. Signal illegal instruciton if data cache block
1096 invalidate is issued from problem state.
1098 * igen.c (max_model_fields_len): New static to keep track of the
1099 max size for the model specific fields.
1100 (model_c_insn): Use max_model_fields_len to size fields.
1101 (insn_table_insert_insn): Set max_model_fields_len.
1102 (model_table_insert): Ditto.
1103 (gen_model_{c,h}): Model_issue is now called with a processor
1106 * debug.c (trace_description): Add support for trace_tbd.
1108 * mon.c (mon_issue): Pass processor argument to model_issue.
1110 * Makefile.in: Delete all function unit support, since the newer
1111 table driven model support replaces it.
1114 * inline.{c,h}: Ditto.
1115 * std-config.h: Ditto.
1117 * configure{,.in}: Ditto.
1118 * Makefile.in: Ditto.
1120 * function_unit.{c,h}: Delete these now usused files.
1122 * std-config.h (WITH_MODEL_ISSUE): Add new macro on whether to
1123 trace instructions in a model specific manor.
1124 * options.c (print_options): Print it out.
1125 * configure{,.in}: Add --enable-sim-model-issue option.
1126 * Makefile.in: Add --enable-sim-model-issue flags.
1127 * igen.c (lf_print_c_semantic): Add call to mon_issue here. Check
1128 for WITH_MODEL_ISSUE.
1129 * mon.c (mon_issue): Remove call to mon_issue_here.
1131 * ppc-instructions: Move branch tracing to the actual branch
1132 instructions, rather than testing it in model_issue. Add code to
1133 code successful/unsuccessful branch predictions, and the number of
1134 conditional branches that fell through.
1138 * cpu.h (cpu_model): Add declaration.
1140 * cpu.c (struct _cpu): Add model_ptr to hold model specific
1142 (cpu_model): Return the model internal pointer.
1143 (cpu_{create,init,halt}): Call the appropriate model function.
1145 * inline.c (mon.c): Move include of mon.c after model.c.
1147 * mon.c (_cpu_mon): Add fields to count unaligned memory
1149 (mon_issue): Call model_issue, not function_unit_issue.
1150 (mon_{read,write}): Count # of unaligned memory accesses.
1151 (mon_print_info): Switch to calling model_mon_info and
1152 model_mon_info_free instead of function_unit version. Print out
1153 number of unaligned reads/writes.
1155 * {ppc-instructions,igen.c}: More global changes to add model
1158 * inline.{c,h}: Provide for inlining options.c.
1159 * options.{c,h}: Ditto.
1160 * std-config.h: Add OPTIONS_INLINE.
1164 * Makefile.in (devices.o, main.o): Update dependency.
1166 * igen.c (gen_model_h): Use correct variable in loop.
1167 (gen_model_c): Use strcmp, strcasecmp.
1168 (gen_model_c): Use EXTERN_MODEL for arrays.
1169 (gen_model_h): Use STATIC_MODEL for arrays.
1170 (lf_print_c_semantic_function_header): Delete unused function.
1172 * main.c (cpu.h): Include cpu.h to get model.h.
1174 * inline.h ({EXTERN,STATIC}_MODEL): Define.
1178 * igen.c ({insn,model}_table_fields): Spell mnemonic correctly.
1179 (gen_itable_h,itable_c_insn): Ditto.
1180 (model support): Move model support around, add support for
1181 model-data, model-internal. Use annex field for model-macros
1184 * configure.in (--enable-sim-inline): If --enable-sim-inline=no,
1185 also define INLINE as nothing.
1186 * configure: Regenerate.
1188 * std-config.h (INLINE): Rather than nuking INLINE, only define it
1189 as __inline__ if any of the INLINE flags are non-zero.
1191 * options.c (print_options): Print out WITH_XOR_ENDAIN.
1193 Mon Nov 13 23:03:45 1995 Andrew Cagney <cagneyhighland.com.au>
1195 * ppc-instructions (rfi): Add missing code.
1197 * cpu.c (cpu_get_time_base): Fix calculation of current value of
1200 * ppc-spr-table (TBL, TBU): Fix TBL/TBU entries - was confusing
1201 m[tf]tb with m[tf]spr.
1203 * ppc-instructions (mtspr, mfspr): Fix mttbl - wasn't storing
1206 Mon Nov 13 21:35:37 1995 Andrew Cagney <cagneyhighland.com.au>
1208 * std-config.h (INLINE, STATIC_INLINE): Was being set to static
1209 inline.. Only problem being that with ppc-opcode-simple this gave
1210 it the chance to inline all the idecode functions with potentially
1211 disasterous results on a 16mb PC. For moment hobble INLINE.
1213 * configure.in, std-config.h (WITH_SMP): Make that 5 processors by
1216 * configure.in: Tweek flags passed to gcc for --with-sim-warnings.
1217 Firstly make them errors and secondly remove the options gcc-245
1222 * misc.c (zalloc), cpu.c (cpu_init), devices
1223 (console_io_read_buffer_callback, icu_io_read_buffer_callback,
1224 vm_io_read_buffer_callback), main.c (zalloc), mon.c (memset),
1225 sim_calls.c (zalloc) : replace bzero() with memset().
1227 * emul_netbsd.c (write_direntries), psim.c (psim_read_register,
1228 psim_write_register): replace bcopy() with memcpy().
1230 Sun Nov 12 20:55:41 1995 Andrew Cagney <cagneyhighland.com.au>
1232 * configure.in: for --disable-sim-inline (--enable-sim-inline=no),
1233 force DEFAULT_INLINE to 0 rather then trusting the std
1236 Sun Nov 12 20:55:41 1995 Andrew Cagney <cagneyhighland.com.au>
1238 * igen.c (lf_print_idecode_table, idecode_table_leaf): Fix
1239 generation of switch entries in tables - treat the same as
1240 cracking/semantic functions.
1242 * igen.c (idecode_switch_end, idecode_switch_leaf): Fix generation
1243 of a boolean switch statement (field zero or non-zero).
1245 * ppc-opcode-test-1, ppc-opcode-test-2: New files. These test the
1246 switch/table generation ability of igen.
1248 * igen.c (idecode_switch_leaf): Fix code output when a switch
1249 statement needs to look up a table.
1251 * igen.c (idecode_declare_if_switch): New function called from
1252 gen_idecode_c - need to declare any idecode switch functions
1253 before they are used in idecode tables.
1255 * igen.c (lf_print_c_cracker_function, idecode_crack_leaf,
1256 idecode_crack_insn): Add is_inline_function argument to code
1257 printing cracker functions which indicates if STATIC_IDECODE or
1258 STATIC_INLINE_IDECODE should be used for definition. For
1259 idecode_crack_insn (which implies not duplicating/expanding) don't
1260 declare function as inline - we assume that the only time this is
1261 code is generated is when things are being tested. For
1262 idecode_crack_leaf, make static (instead of INLINE) if the
1263 instructions parent is a table as function will always be called
1266 * igen.c (idecode_expand_if_switch): Declare as STATIC_IDECODE not
1267 STATIC_INLINE_IDECODE. Only the outermost idecode switch will be
1268 called directly, all others are called via a table.
1270 * igen.c (lf_print_semantic_function_header, semantics_h_leaf,
1271 semantics_h_insn, semantics_h_function,
1272 lf_print_c_semantic_function, semantics_c_function): Add
1273 is_inline_function argument to lf_print_semantic_function_header
1274 to indicate if an inline or static function declaration/definition
1275 should be output. Depending on situtation call accordingly:
1276 functions (not instruction semantic routines) are always inline;
1277 Semantic routines are made inline when there is no icache (cache
1278 will contain the function address) and are duplicating (see above)
1279 and the parent of the instruction is a switch statement.
1281 * igen.c (opcode_field_new): Delete. Code changed to use ZALLOC
1282 and moved to insn_table_find_opcode_field.
1284 * table.c (table_open): Fix typo (nr_model_fields vs nr_fields).
1286 * igen.c (model_c_insn): Suggestion - document the name of the
1287 instruction on each line of the instruction model table.
1289 Fri Nov 10 00:44:38 1995 Andrew Cagney <cagneyhighland.com.au>
1291 * emul_netbsd.c (do_ioctl): Cleanup compilation.
1293 * sim_callbacks.h (__attribute__): Only define if not defined (was
1294 already defined on NetBSD host).
1296 Wed Nov 8 21:49:52 1995 Andrew Cagney <cagneyhighland.com.au>
1298 * std-config.h (WITH_XOR_ENDIAN), configure.in, Makefile.in: New
1299 macro, indicates if the PowerPC's horrible XOR endian mode should
1300 be suported. Add to configure and make.
1302 * vm_n.h (vm_data_map_read_N, vm_data_map_write_N), vm.c
1303 (vm_instruction_map_read): If XOR endian, xor the address
1304 with a value from an xor table (indexed by size of access).
1306 * vm.c (vm_synchronize_context), cpu.c (cpu_synchronize_context):
1307 set up xor table to xor if there is a conflict between the
1308 CURRENT_TARGET_ENDIAN and the endian indicated in the MSR. Move
1309 check of suported change of endian mode from cpu.c to vm.c.
1311 * vm.c (vm_data_map_write_buffer, vm_data_map_read_buffer):
1312 Hopefully added correct hack to handle XOR endian mode.
1314 FIXME: If NONSTRICT alignment and XOR ENDIAN and MSR indicates
1315 little endian mode, the model accepts miss aligned transfers.
1317 FIXME: Need to create an `init' device that, during
1318 initializatioin for XOR mode, it mushes (XOR address) all the dma
1319 data before passing it on to the core for storage. Just like the
1322 Wed Nov 8 21:49:52 1995 Andrew Cagney <cagneyhighland.com.au>
1324 * devices.c (halt_io_write_buffer_callback): Use value written to
1325 halt device to determine exit status. Thus allowing
1326 success/failure of OEA tests.
1328 Wed Nov 8 00:10:38 1995 Andrew Cagney <cagneyhighland.com.au>
1330 * ppc-instructions (icbi): If icache present flush it.
1332 Tue Nov 7 23:36:31 1995 Andrew Cagney <cagneyhighland.com.au>
1334 * devices.c (htab_init_callback): Add code to create htab/pte.
1336 * devices.c (dma_file, file_init_callback, htab_init_callback):
1337 New function - Dma the named file into memory at the specified
1340 * device_tree.h, device_tree.c (scand_*): New functions.
1342 Tue Nov 7 23:36:31 1995 Andrew Cagney <cagneyhighland.com.au>
1344 * filter_filename.c, Makefile.in: Change so that only dependant on
1345 a very limited nr of files. Stops an unnecessary dependency.
1349 * core.c (core_map_find_mapping): Use cpu_halt rather than error
1350 to abort an access to an undefined address.
1354 * igen.c (model_table_insert_{macro,function}): New functions.
1355 (insn_table_load_insns): Call them.
1356 (gen_model_h): Move section emiting model-macros to be first.
1357 (model_{c,h}_function): New functions cloned from semantic
1358 functions to print out the prototype and function for
1360 (gen_model_{c,h}): Print out model-functions.
1362 * ppc-instructions (model_{start,halt,print_info}): Add dummy
1365 * options.c (print_options): Print out WITH_{,DEFAULT_}MODEL, not
1366 WITH_PPC_{,DEFAULT_}_MODEL.
1367 (options_ppc): Delete now unused function.
1368 (cpu.h): Include cpu.h, not just basics.h.
1370 * std-config.h (WITH_{,DEFAULT_}MODEL): Define.
1372 * igen.c (model_macros, last_model_macro): New statics to keep
1373 track of macros to go in model.h.
1374 (insn_table_load_insns): Add model-macros to model_macros linked
1376 (model_table_fields): Add field for printable name.
1377 (gen_model_h): If there are model macros defined, print them out.
1378 Print out DEFAULT_MODEL as the first model if there any models
1379 specified, otherwise MODEL_NONE. Print out external decl for
1380 current_model. Print out decl for model_set.
1381 (gen_model_c): Add function model_set. Switch to use printable
1382 name for the model, not the internal identifier used.
1384 * psim.c (current_model): New global variable.
1386 * ppc-instructions: Add macros for flag defines. Switch first
1387 model so 604 is first.
1389 * main.c (main): Call model_set, not function_unit_model.
1390 * sim_calls.c (sim_open): Ditto.
1391 * sim_calls.c, Makefile.in: sim_calls.c now includes cpu.h.
1395 * mon.h (mon_events): New enumeration for other events we want to
1397 (mon_event): Add declaration for function.
1399 * mon.c (mon_event): New function.
1400 (mon_print_info): Print icache misses.
1402 * psim.c (run_until_stop): Monitor icache misses.
1404 * configure.in (--enable-sim-inline): Fix typos in handling comma
1405 separated inline options.
1406 (--enable-sim-icache): Echo icache size.
1407 * configure: Regenerate.
1409 * igen.c (semantics_h_print_function): Emit STATIC_SEMANTICS
1410 instead of INLINE_SEMANTICS so that the compiler won't keep all of
1411 the semantic functions as inline RTL, given that the address of
1412 the function is taken which forces outline calls anyway.
1413 (lf_print_c_semantic_function_header): Ditto.
1414 (gen_semantics_h): Define STATIC_SEMANTICS as nothing if not
1416 (lf_print_c_cracker_function): Emit STATIC_IDECODE instead of
1417 STATIC_INLINE_IDECODE.
1418 (gen_idecode_c): Define STATIC_IDECODE if not defined.
1419 (gen_model_h): Use #ifdefs to define types to hold model units,
1421 (model_table_insert): Add a sentinel functional unit at the end to
1422 simplify loop processing.
1423 (model_c_insn): Use <function-unit>_SENTINAL instead of 0 for any
1424 instruction not specifing a function unit for the current model.
1425 (gen_model_{c,h}): Provide bounds for model_time_mapping.
1427 * inline.h (STATIC_SEMANTICS): Define to be static if
1428 SEMANTICS_INLINE is defined.
1429 (STATIC_IDECODE): Define to be static if IDECODE_INLINE is
1432 * options.c (print_options): Fix typo.
1436 * configure.in (--enable-sim-{opcode,config}): Use $srcdir when
1437 check for the existence of files.
1438 * configure: Regenerate.
1440 * table.c (table): New field nr_model_fields.
1441 (table_open): New parameter nr_model_fields.
1442 (table_entry_read): Parse model fields that begin with a '*' after
1444 * igen.c, dgen.c: Change callers of table_open.
1446 * igen.c: Add support for dumping model specific information in
1447 model.h and model.c.
1448 (insn_field_name): Delete unused array.
1449 (global variables): Make global variables static, so we can tell
1450 when they are no longer used.
1451 (cache_semantic_actual): Delete unused variable.
1452 (insn_table_load_insns): If the insn is really a machine model,
1453 call model_table_insert instead of other processing.
1454 (model_table_insert): New function to handle defining the
1455 functional units of a particular machine model.
1456 (insn_table): Add last_function field so we can add functions at
1458 (insn_table_insert_function): Use last_function field when
1459 appending new function.
1461 * ppc-instructions: Add a few model specific information for 603,
1462 603e, and 604 for testing purposes.
1464 * table.h (table_model_entry): New linked list to hold model
1465 specific information, one per line.
1466 (table_entry): Add model_first, model_last fields.
1468 * configure.in (--enable-sim-inline): If gcc is found and
1469 --enable-sim-inline is not specified, defaine DEFAULT_INLINE to 1,
1471 (--enable-sim-reserved-bits): New switch to check whether reserved
1472 bits are set in the instruction.
1473 (--enable-sim-opcode): Make complex the default.
1474 (all switches): Add appropriate checks and error messages.
1475 * configure: Regenerate.
1477 * Makefile.in (RESERVED_CFLAGS): New variable set by
1478 --enable-sim-reserved-bits.
1479 (CONFIG_CFLAGS): Include RESERVED_CFLAGS.
1480 (BUILT_SRC): igen now generates model.c and model.h.
1481 (LIB_OBJ): Include table.o.
1482 (tmp-igen): Add -m/-M options to write model.c/model.h.
1483 (model.o): New object.
1484 (CPU_H): Include model.h.
1486 * cpu.h: Include model.h.
1488 * std-config.h (WITH_RESERVED_BITS): Define.
1489 (MODEL_INLINE): Ditto.
1491 * options.c (print_options): Print out WITH_RESERVED_BITS.
1495 * configure.in: If --silent, don't output information messages.
1496 * configure: Regenerate.
1498 * configure.in (--enable-sim-alignment): Fix typo in specifing non
1500 (--enable-sim-switch): Make default on.
1501 (--enable-sim-duplicate): Make default on.
1502 (--enable-sim-smp): Make default 0.
1503 (--enable-sim-mon): Don't set sim_float if not set.
1504 (--enable-sim-inline): If gcc is found and --enable-sim-inline is
1505 not specified, define DEFAULT_INLINE to be 2.
1506 (all --enable-sim-* rules): Echo rules set to non empty to file
1508 * configure: Regenerate.
1510 * options.c (options_env): Fix typo if WITH_ENV is 0.
1511 (print_options): Print GCC compiler version if available and
1512 date/time options was compiled. If OPCODE_RULES, IGEN_FLAGS,
1513 and/or DGEN_FLAGS are defined, print them.
1515 * Makefile.in (all link actions): Pass SIM_CFLAGS as well as
1517 (options.o): Compile options.o with OPCODE_RULES, IGEN_FLAGS, and
1518 DGEN_FLAGS defined, so they can be printed out.
1520 * igen.c (lf_print_c_validate): Check for WITH_ASSERT, so that
1521 this test can be compiled away if the user really wants a fast
1522 simulator by not doing assertion failures.
1526 * options.c: New file to print out all of the WITH_ options.
1527 * options.h: New include file to declare print_options.
1528 * debug.h (trace_options): Add trace_opts to call print_options.
1529 * debug.c (trace_description): Add trace_opts support.
1530 * main.c (main): If user requested options, print them.
1531 * sim_calls.c (sim_open): Ditto.
1533 * igen.c (opcode_field_new): Add void to make it a proper prototype.
1535 * emul_generic.c (emul_enter_call): Make printf_filtered arguments
1537 * emul_netbsd.c (do_kill): Ditto.
1538 * registers.c (registers_dump): Ditto.
1539 * vm.c (om_translate_effective_to_real): Ditto.
1540 * vm_n.h (vm_data_map_read_N): Ditto.
1541 (vm_data_map_write_N): Ditto.
1542 * devices.h (DTRACE_INIT): Ditto.
1543 (DTRACE_{ATTACH,DETACH}_ADDRESS): Ditto.
1544 (DTRACE_IO_{READ,WRITE}_BUFFER): Ditto.
1545 (DTRACE_DMA_{READ,WRITE}_BUFFER): Ditto.
1546 * devices.c (update_for_binary_section): Ditto.
1547 (write_stack_arguments): Ditto.
1548 (stack_ioctl_callback): Ditto.
1549 * device_tree.c (device_tree_add_passthrough): Ditto.
1550 (device_tree_{add,find}_device): Ditto.
1551 (device_tree_{add,find}_integer): Ditto.
1552 (device_tree_find_{string,boolean}): Ditto.
1553 (device_tree_init{,_device}): Ditto.
1554 (device_tree_dump): Ditto.
1555 * sim_calls.c (sim_{read,write}): Ditto.
1556 (sim_{fetch,store}_register): Ditto.
1557 (sim_stop_reason): Ditto.
1559 * sim_callbacks.h (printf_filtered): Declare with attribute
1560 printf, so we can enable format checks.
1562 * devices.c (console_io_{read,write}_buffer_callback): Cast swtich
1563 argument to int, since ANSI doesn't allow long switch values.
1564 * emul_netbsd.c (do___sysctl): Ditto.
1566 * emul_netbsd.c (do___sysctl): Fix up printf call.
1568 * corefile.c (core_translate): Don't do arithmetic with void *
1569 pointers. Cast to char * first.
1571 * function_unit.c (FUNC_{LOAD,STORE}): Rename from {LOAD,STORE}
1572 and change all uses.
1574 * Makefile.in ({FUNC,MODEL,WARNING}_CFLAGS): New flags set by
1575 configure --enable switches.
1576 (CONFIG_CFLAGS): Include FUNC_CFLAGS and MODE_CFLAGS.
1577 (.c.o): Include WARNING_CFLAGS.
1578 (CPU_H): Include function_unit.h.
1579 (LIB_OBJ): Include function_unit.o.
1580 (BUILT_SRC_WO_CONFIG): Split from BUILT_SRC and do not include
1581 config.h or ppc-config.h.
1582 (BUILT_SRC): Include BUILT_SRC_WO_CONFIG, config.h and
1584 (filter_filename.o): Include config.h/ppc-config.h dependencies.
1585 (idecode.o, semantics.o, psim.o): Specify CC line without
1586 WARNING_CFLAGS so that we don't get all of the unused variable
1587 warnings that are generated.
1588 (function_unit.o): Add rule to build.
1589 (main.o, sim_calls.o): Add function_unit.h, itable.h dependencies.
1590 (mon.o): Include mon.c dependency.
1591 (TAGS): Depend on BUILT_SRC.
1592 (clean): Don't delete config.h or ppc-config.h
1594 * basics.h (sim_callbacks.h): Move include after the include of
1595 config.h and ppc-config.h.
1597 * bits.{h,c} (ROTL32,ROTL64): Move these functions to bits.c. Add
1598 support for BITS_INLINE to inline these. Add declarations to
1601 * configure.in (--enable-sim-warnings): Add new option to specify
1602 compiler warnings for all modules except idecode.o and semantics.o
1603 which have lots of unused variables because they are machine
1605 (--enable-sim-function-unit): New switch to configure whether
1606 function unit support is compiled in or not.
1607 (--enable-sim-{,default-}mode): New switches to control which cpu
1609 * configure: Regenerate.
1611 * corefile.c (core_attach_address_callback): Delete unused
1612 variable device_address.
1614 * cpu.c (struct _cpu): Add function unit pointer field func_unit.
1615 (cpu_create): If WITH_FUNCTION_UNIT, call function_unit_create.
1616 (cpu_init): If WITH_FUNCTION_UNIT, call function_unit_init.
1617 (cpu_halt): If WITH_FUNCTION_UNIT, call function_unit_halt.
1618 (cpu_function_unit): New function to return func_unit field.
1620 * cpu.h (function_unit.h): Include new include file.
1621 (cpu_function_unit): Declare.
1623 * debug.c (stdlib.h): Test HAVE_STDLIB_H, not HAVE_STDLIB.
1624 (config.h): Include config.h.
1626 * devices.c (icu_io_write_buffer_callback): Delete unused variable
1629 * emul_generic.c (emul_exit_call): Print out status value.
1631 * emul_netbsd.c (do_read): Delete unused variable nr_moved.
1633 * filter_filename.h (includes): Include config.h, ppc-config.h,
1636 * inline.c: Include bits.c if BITS_INLINE. Include
1637 function_unit.c if FUNCTION_UNIT_INLINE.
1639 * inline.h (INLINE_BITS): Define if BITS_INLINE.
1640 (INLINE_FUNCTION_UNIT): Define if FUNCTION_UNIT_INLINE.
1642 * interrupts.c (instruction_storage_interrupt): Delete unused
1645 * lf.h (config.h): Include config.h.
1647 * main.c (includes): Include function_unit.c. If HAVE_UNISTD_H,
1649 (usage): Update for -m model, -i, and -I options.
1650 (main): Delete unused variables stack_pointer and i. Add support
1651 for -i, -m model arguments. Call psim_print_info with verbose ==
1652 1 if -i, and verbose == 2 if -I.
1654 * mon.c (stdio.h): Include stdio.h to pick up sprintf prototype.
1655 (mon_issue): Call function_unit_issue if function units are
1657 (mon_print_info): Take psim * argument. Print out information
1658 from function_unit if available. Move read/write stats to always
1659 print, instead of printing if verbose > 1. Fix up plural
1662 * mon.h (mon_print_info): Update prototype.
1664 * psim.c (current_ppc_model): Add global variable.
1665 (psim_print_info): Pass system argument to mon_print_info.
1667 * sim_calls.c (function_unit.h): Include.
1668 (sim_open): Add support for -i and -m model options. If -i call
1669 psim_print_info with verbose == 1, if -I, with verbose == 2.
1670 (sim_resume): Delete unused variable program_counter.
1672 * std-config.h (WITH_FUNCTION_UNIT): Define.
1673 (ppc_model): Add enumeration giving all PowerPC models currently
1675 ({WITH,CURRENT}_PPC_MODEL): Define.
1676 (FUNCTION_UNIT_INLINE): Define.
1678 * table.c (config.h): Include config.h.
1680 * vm.c (om_virtual_to_real): Print pte_word_{0,1} so the compiler
1681 doesn't complain that they're unused.
1683 * vm_n.h (vm_data_map_read_N): Delete unused variable rval.
1687 * sim-endian.c (ppc-endian.c), sim-endian.h (ppc-endian.h):
1688 renameed. These files are target independant.
1689 * Makefile.in, basics.h: update for new name.
1691 * sim-endian.h (SWAP_N), sim-endian.c (_SWAP_1): Rename existing
1692 SWAP_<N> to _SWAP_<N> so that sim-endian.h can contain SWAP_N
1693 macro's as required.
1695 * sim-endian.c, sim-endian-n.h (new file): Move endian code into a
1696 debugable header file.
1698 * ppc-instructions (Byte-Reverse): Enable byte reverse
1699 instructions using SWAP_N macros.
1703 * Makefile.in (config.status): Remove references to config.make
1706 * config.{make,hdr}: Delete, no longer used.
1707 * build-psim: Ditto.
1711 * sim_calls.c (sim_open): Fix parsing of `target sim' options.
1713 * device_tree.c (device_tree_add_string): Wasn't saving the value
1714 of the string being entered into the tree.
1716 * psim.c (create_filed_device_tree): Not terminating string device
1719 * psim.c (psim_create): Use `env' instead of
1720 `environment-architecture' to be consistent with configure.
1721 Reconize user/uea, virtual/vea and operating/oea.
1725 * core.c: Rename to corefile.c
1726 * core.h: Rename to corefile.h
1727 * inline.c: Include corefile.h, renamed from core.h.
1728 * cpu.h: Include corefile.h, renamed from core.h
1729 * vm.c: Include corefile.h, renamed from core.h
1730 * corefile.c: Include corefile.h rather than core.h
1731 * README.psim (KNOWN PROBLEMS): Change core.* references to corefile.*
1733 * Makefile.in (CPU_H): Change core.h to corefile.h
1734 (vm.o): Change dependency to corefile.h
1735 (LIB_SRC): Change core.c to corefile.c.
1736 (LIB_OBJ): Change core.o to corefile.o.
1737 (corefile.o): Change dependencies to corefile.c, corefile.h.
1741 * ppc-instructions (data cache instructions): Make all data cache
1742 instructions nops instead of invalid instructions.
1744 * Makefile.in (CONFIG_CFLAGS): Add ALIGNMENT_CFLAGS and
1745 TIMEBASE_CFLAGS which weren't included.
1749 * Makefile.in: Uncomment built file dependencies.
1751 * configure.in: Rewrite --enable-sim switch handling to use the
1752 autoconf builtins so it works correctly if the configure or
1753 Makefile.in files are modified and make decides to rebuild
1754 Makefile. Also document all of the --enable-sim switches
1755 supported. Check whether getrusage and sys/resource.h are
1757 * config.in: Regenerate.
1758 * configure: Regenerate.
1759 * Makefile.in: Add support for all of the variables set with
1760 --enable-sim switches.
1762 * Makefile.in (clean): make clean now removes all built sources as
1765 * cpu.c: Use HAVE_STRING_H, HAVE_STRINGS_H, HAVE_UNISTD_H,
1766 HAVE_TIME_H, HAVE_SYS_TIMES_H, HAVE_SYS_RESOURCE_H defined in
1767 the generated config.h.
1769 * device_tree.c: Ditto.
1772 * emul_netbsd.c: Ditto.
1777 * registers.c: Ditto.
1778 * sim_calls.c: Ditt.
1782 * main.c (main): Call psim_print_info with verbose == 2.
1784 * mon.c (mon_print_info): Align the cpu number and number of
1785 instructions fields. Do not print an instruction category if the
1786 CPU did not execute any of those instructions. Print out number
1787 of reads and writes. If getrusage is supported, print out number
1788 of simulated instructins per second.
1790 * configure.in: Add support for --enable-sim-opcode=stupid.
1791 * configure: Regenerate.
1795 * std-config (INLINE_DEVICE_TREE): Don't inline either of
1796 device_tree.c or devices.c. There is no significant gain.
1798 * configure.in, Makefile.in: add --enable-sim-icache=[0-9]* and
1803 * igen.c (main), misc.h (target_a2i, i2target), misc.c: Add
1804 functions to convert between target and igen internal bit numbers.
1805 Make IO go through these functions. Add -b (bit size) and -h (high
1806 bit nr) options to igen. Typical usage would be: ./igen -b 16 -h
1807 15 for a 16 bit instruction format with the msb given a number 15.
1811 * dgen.c (main): Was outputting optarg even when it was NULL.
1815 * vm_n.h (vm_data_map_load_N, vm_data_map_store_n), debug.h,
1816 debug.c: Add tracing of load/store unit (virtual) with -t
1821 * std-config.h (WITH_ENVIRONMENT): Add USER_ENVIRONMENT which does
1822 not include things such as the time base and events.
1824 * interrupt.c, sim_calls.c, cpu.h, vm.c, configure.in: Add UEA to
1825 all environment switches for above.
1827 * psim.c (psim_create): ditto - new device tree node name is
1828 /options/environment-architecture with values user, virtual and
1833 * ppc-opcode-stupid: Third example of use of opcode table - this
1834 one expands all mtspr/mfspr and branch instructions. Appears to
1835 give about a 10% gain in performance if everything enabled. Also
1836 takes about 150mb of swap to build.
1840 * emul_netbsd.c (do_exit): Print arguments and close parenthesis
1841 if tracing, since exit doesn't go through emul_exit_call.
1842 (do_read): Print arguments if tracing.
1848 (do_sigprocmask): Replace trace with printing arguments if
1850 (do_ioctl): Print arguments if tracing.
1854 (do_gettimeofday): Ditto.
1855 (do_getrusage): Ditto.
1856 (do_fstatfs): Ditto.
1858 * filter_filename.c: New file to provide filter_filename to strip
1859 the directory prefix from a file.
1860 * filter_filename.h: New include file to declare filter_filename.
1862 * debug.h: Include filter_filename.h.
1863 (TRACE,DTRACE,ERROR): Use filter_filename on __FILE__.
1865 * misc.h: Include filter_filename.h.
1866 (ASSERT): Use filter_filename on __FILE__.
1868 * igen.c (lf_print_my_prefix): Use filter_filename on the filename
1871 * Makefile.in: Add filter_filename support.
1873 * ppc-instructions (dcbi, icbi): Make these NOPs rather than
1874 invalid instructions.
1876 * configure.in: Add support for more --enable-sim-* switches.
1877 Use config.make and config.hdr to write to Makefile and config.h
1878 respectively. Don't rewrite Makefile, just append to it.
1879 * configure: Regenerate.
1880 * config.{make,hdr}: New shell scripts.
1882 * Makefile.in: Remove all variables set by configure.in.
1883 (psim.o): Depend on $(BUILT_SRC) also.
1885 * emul_netbsd.c (do_gettimeofday,do_getrusage): When comparing an
1886 integer, use 0, not NULL.
1890 * configure.in: Add support for --enable-sim-inline,
1891 --enable-sim-bswap, --enable-sim-cflags, --enable-sim-complex,
1892 --enable-sim-switch, --enable-sim-duplicate, --enable-sim-filter,
1893 and --enable-sim-endian switch to control various Makefile
1895 * configure: Regenerate from configure.in.
1896 * Makefile.in: Add various Make variables that the various
1899 * std-config.h (DEFAULT_INLINE): Don't set this to 2 if using GCC
1900 and optimizing by default.
1904 * bits.h (ROTL32, ROTL64): Were functions, made them macros, now
1905 make them functions again. Appears 2.6.3 is confused by just a
1910 * ppc-endian.c (SWAP_8): Fix 8 byte swap!
1912 * psim.c (psim_create): Not correctly checking that runtime
1913 configuration of things like ENDIAN, ENVIRONMENT and ALIGNMENT
1914 matched the compiled in ones.
1916 * debug.h (ITRACE), igen.c: Tidy up more tracing flags -
1917 trace_semantics is now different to trace_idecode, the former
1922 * ppc-instructions (mtsrin): Missing instruction
1923 * ppc-instructions (mfsrin): Missing instruction
1924 * ppc-instructions (eieio): Missing instruction
1928 * build-psim: New shell script - see internals for usage,
1929 simplifies the process of building custom simulators.
1933 * std-config.h (SEMANTICS_INLINE): Tidy up notes on each of the
1934 INLINE macros. Make SEMANTICS_INLINE == 1 if DEFAULT_INLINE == 2.
1935 Don't use DEFAULT_INLINE to define REGISTERS_INLINE DEVICES_INLINE
1936 DEVICE_TREE_INLINE or INTERRUPTS_INLINE as none of these are on
1937 the instruction or data critical paths.
1939 * FIXME: devices.c/emul_netbsd.c would benefit (slightly) from
1940 the inclusion of device_tree.c/emul_generic.c.
1944 * os_emul.[hc], emul_generic.[hc], emul_netbsd.[hc]: replace
1945 system.[hc]. Start of suport for multiple emulations and
1946 emulation state (os_emul object).
1948 * emul_generic.[hc]: Start of code to implement proper system call
1953 * cpu.h, cpu.c (cpu_init): New function, zero the registers before
1954 the processor is started. Fixes problem of registers being
1955 undefined when restarting from within gdb.
1957 * cpu.h, cpu.c (cpu_flush_icache): New function, flushes the
1958 instruction cache (if present). Fixes problem of cpu caching gdb
1959 breakpoint instructions.
1961 FIXME: PSIM sometimes aborts calling error(), it should instead
1962 call sim_error() say which takes care of housekeeping such as
1963 saving the CIA before calling error.
1965 * NOTE: cpu_flush_cache() instead of cpu_synchronize_context() is
1966 used when restarting a simulation because the latter has the
1967 unwanted side effect (well I as a kernel hacker think it is) of
1968 performing an isync when the instruction stream doesn't contain
1973 * mon.h (new), mon.c (new), std-config.h (WITH_MON): Performance
1974 monitoring module. Counts both instructions issued and
1977 * NOTE: mon does not contain to count instruction loads as this
1978 information is already available from the mon_issue() hook.
1980 * igen.c (lf_print_c_semantic), vm_n.h: Add counting code.
1982 * psim.h, psim.c (psim_create), cpu.h, cpu.c (cpu_create): Attach
1983 a common monitor to each of the cpus. Delete
1984 cpu_increment_number_of_insns() and cpu_get_number_of_insns()
1985 replaced by copied code in mon.[hc].
1989 * sim_calls.c, main.c, psim.c (psim_create): always create
1990 `WITH_SMP' cpus. The actual number of CPU's active in a
1991 simulation run is taken from the device node: /init/smp (an
1992 integer). WITH_SMP changed to 2 (remember to put it back to 0).
1996 * system.c: More system call emulation. If code appears NetBSD
1997 specific, make conditional to being compiled on a NetBSD system
2002 * Makefile.in, gen.c(delete), igen.c(new), dgen.c(new),
2003 lf.[ch](new), table.[ch](new): Split into two generators - igen
2004 that outputs the instruction tables and dgen that outputs the spr
2005 tables. Add -f (filter out) flag to igen to filter out certain
2006 instructions (ex 64 bit ones) from the created tables. Include
2007 $(LIBIBERTY_LIB) in link options in case host lacks some libc
2010 * NOTE: igen, since it was originally written for the
2011 PowerPC/RS6000, things the MSB is 0 and the LSB is 63{31}.
2013 * Makefile.in, std-config.h, ppc-cache-rules(new),
2014 ppc-opcode-complex(new), ppc-opcode-simple(new): (for igen) Create
2015 cache-rule and opcode-rule tables from macros found std-config.h.
2016 Delete corresponding macro's from std-config.h.
2018 * igen.c (gen_itable_c, gen_itable_h), Makefile.in: code to output
2019 an table of all the instructions. Code to output a type
2020 enumerating all the instructin names.
2022 * igen.c(lf_print_c_semantic): Move call to increment instruction
2023 counter so that it occures _after_ the instruction has been fully
2024 validated, was double counting illegal/invalid instructions. Add
2025 conditional so only compiled in when WITH_PROFILE enabled (enabled
2028 * igen.c, cpu.h, cpu.c(cpu_increment_number_of_insns): Include
2029 itable.h, count individual instruction types not just total,
2030 adjust reporting functions to output this.
2032 * ppc-instructions (64 bit Load Doubleword with Update Indexed):
2033 Had 32./ instead of 31./
2035 * ppc-instructions (64 bit Store Double Word Conditional Indexed):
2036 bitrot - updated to use newer CR register operators.
2038 * ppc-instructions (64bit Floating Convert from Integer
2039 Doubleword): Correct call to Round_Float().
2043 * basics.h: #include "sim_callbacks.h" earlier so that its
2044 prototypes are declared in all other header files.
2046 * bits.h, bits.c, idecode_expression.h (ROTL32, ROTL64): Update
2047 doc in bits.h, remove dead code in bits.c, move ROTL32/ROTL64 into
2050 * cpu.c(cpu_add_commas), device_tree.h, device_tree.c(scand_*):
2051 Add size of buffer argument to functions writing a string into a
2052 buffer. Check for buffer overflow.
2056 * devices.h, devices.c, debug.h, debug.c: add macro's for tracing
2057 of each device. Make parameter names consistent so macros work.
2058 Use macro's in device functions.
2060 * device_tree.c, devices.h, devices.c: include path to device in a
2061 devices node when creating it.
2063 * device_tree.c, debug.h, debug.c: Add tracing of `device-tree'.
2065 * core.c: add tracing of core-device, adjust parameter names in
2066 core functions to be consistent with those in devices*.
2070 * debug.h, debug.c (trace_option): New function. Parses the trace
2071 option, updating the trace array.
2073 * debug.h, debug.c (trace_usage): New function. Outputs the list
2074 of all possible trace options.
2076 * sim_calls.c (sim_open), main.c (main): Use new trace_option() to
2077 parse trace options specified with the simpler -t flag. Adjust
2082 * Makefile.in (clean): Delete *.i and *.out files.
2084 * ppc-endian.c (SWAP_n): Add SET argument to allow use of SWAP
2085 macros for either assignment or return. Fix SWAP_8 to use a
2086 union, and two SWAP_4's. Delete SWAP_N, since nobody uses it now.
2087 (ENDIAN_N): Add SET argument to SWAP_n calls. Delete macro defs
2088 that hardwired swapping on/off, let optimizer delete dead code.
2090 * main.c (main): Add printf that we caught a signal and print out
2091 the failing address.
2095 * Makefile.in: Remove tabs from otherwise empty line.
2096 Confuses many non-GNU versions of "make".
2100 * Makefile.in (clean): Delete files produced by gen.
2104 * gen.c (lf_print_c_semantic_function): Move counting # of
2105 instructions here so it works with caching.
2106 (gen_idecode_c): Move from here.
2110 * gen.c, ppc-instructions, psim.c: Fix code for generating
2111 cracking instruction cache. Delete the code that cached just the
2112 result from doing an instruction lookup - this ran slower than no
2117 * Makefile.in (gen.o): Include $(INLINE_CFLAGS).
2119 * debug.h (ppc_trace): Rename from trace, to avoid a conflict with
2120 TCL when gdb is linked with the simulator.
2121 * debug.c (ppc_trace): Ditto.
2122 * sim_calls.c (sim_open): Change trace -> ppc_trace.
2123 * main.c (main): Ditto.
2125 * cpu.c (cpu_add_commas): Remove extra static.
2129 * Makefile.in (psim.o): Now that inlines are turned on, make
2130 psim.o depend on all sources.
2132 * cpu.c (cpu_add_commas): New function to format a long with
2134 (cpu_print_info): Use it to print number_of_insns.
2136 * ppc-endian.c (SWAP_n): New macros to speed up byte swapping for
2138 (ENDIAN_N): If both target and host byte orders are known, don't
2139 bother testing CURRENT_{TARGET,HOST}_BYTE_ORDER.
2141 * ppc-endian.h (target specific H2T_n/T2H_n macros): Remove #if 0
2142 to allow target specific H2T_n/T2H_n macros to be used.
2143 (htonl, ntohl): If compiled on a 486 by GCC and WITH_BSWAP is
2144 non-zero, redefine the htonl/ntohl macros to use the BSWAP instead
2145 of the 3 instruction sequence that runs on 386s.
2147 * std-config.h (WITH_{HOST,TARGET}_BYTE_ORDER): Don't override if
2148 specified on the compile line.
2149 (WITH_BSWAP): If not defined, define as 0.
2151 * Makefile.in (INLINE_CFLAGS): Add -DDEFAULT_INLINE=2 to add
2152 default inline support. Pass INLINE_CFLAGS when compiling.
2154 * devices.{h,c} (unimp_device_ioctl): Use STATIC_DEVICES, not
2155 INLINE_DEVICES since GCC doesn't like inline functions that
2156 accept variable arguments.
2157 (stack_ioctl_callback): Make function just static because GCC
2158 doesn't like inline functions that accept variable arguments.
2160 * devices.h (STATIC_DEVICES): Define as empty if not defined.
2162 * inline.c: Correct pathnames of included C files to match current
2165 * inline.h (STATIC_DEVICES): If DEVICES_INLINE is defined to be
2166 non-zero, define STATIC_DEVICES to be static.
2168 * std-config.h (INLINE): If GNU C and optimizing, define this as
2170 (DEFAULT_INLINE): If not defined, define as 0.
2171 (ENDIAN_INLINE): If not defined, define as DEFAULT_INLINE.
2172 ({CORE,VM,CPU,EVENTS,REGISTERS,INTERRUPTS}_INLINE): Ditto.
2173 ({SPREG,IDECODE}_INLINE): Ditto.
2177 * ppc-instructions: Initial cut of floating point suport added.
2178 Of note include - use of host IEEE floating point instructions,
2179 use of PowerPC manual pseudo code to handle the FPSCR. It is not
2180 currently a pretty sight.
2182 * memory_map.h, memory_map.c, memory_map_n.h, core.h, core.c:
2183 merge into core.h, core.c, core_n.h. The type memory_map replaced
2184 with core_map. This removes a level of pointer indirection when
2185 translating an address.
2187 * memory_map.h, memory_map.c, memory_map_n.h: delete.
2189 * Makefile.in et.al (sorry): tweek to use new core, core_map and
2194 * sim_calls.c, main.c: Add -g (trace_gdb) option, add tracing to
2195 most of the other functions in sim_calls.c.
2197 * basics.h (CONCAT3), memory_map.c, memory_map_n.h, Makefile.in:
2198 Add macros to better cover up `generic' code. Makes it possible
2199 to step through the generic code!
2201 * vm.c, vm_n.h, Makefile.in: ditto
2205 * devices.h, devices.c, memory_map.h, memory_map.c: Changed
2206 callback interface so that there is a read/write buffer but no
2207 read/write_word. VEA default memory read/write handler sometimes
2208 couldn't resolve an access and of those some were for a memory
2209 fault and some were because gdb was making a bogus request.
2211 * devices.h, devices.c, memory_map.h, memory_map.c, vm.h, vm.c:
2212 eliminate transfer_mode (raw or cooked) parameter from read/write
2217 * ppc-instructions (fmul, fmuls): correct instruction format - had
2222 * psim.c, device_tree.h, device_tree.c, devices.c (printd_*,
2223 scand_*): new functions to parse/print fields in device names
2224 while hiding any machine dependency.
2226 * devices.c, psim.c: Change the stack init code so that it is
2227 handled by a device. Arguments passed across using a device ioctl
2230 * devices.h, devices.c: device ioctl callback changed to allow a
2231 variable number of arguments. This gives greater flexability and
2232 greater chance of bugs.
2236 * main.c (printf_filtered, error): Missing va_end() to close off
2237 variable argument use.
2239 * Makefile.in (tmp-gencode): comment out hack to get around some
2240 versions of make not handling files being created as side-effects.
2242 * gen.c (lf_open): Add -n (real_file_name) option. Specifies an
2243 alternative file name to use in output files for things like #line
2246 Makefile.in (tmp-gencode): Use gen -n so that debug info is
2249 * Makefile.in (TARGETLIB): Use this instead of libsim.a in the
2254 * sim_calls.c (sim_set_callbacks): Define new function.
2258 * psim.c (psim_print_info): Print exit status or signal number.
2262 * cpu.c (struct _cpu): Add number_of_insns field to trace how many
2263 instructions are executed.
2264 (cpu_increment_number_of_insns): New function to increment the
2265 number of instructions issued.
2266 (cpu_get_number_of_insns): New function to return the number of
2267 instructions issued.
2268 (cpu_print_info): New function to print cpu related information.
2269 At present, print the number of instructions executed.
2271 * gen_idecode_c: Emit call to cpu_increment_number_of_insns within
2274 * psim.c (psim_print_info): New function to iterate over each of
2275 the CPU's calling cpu_print_info.
2277 * psim.h,cpu.h: Add new declarations.
2279 * sim_calls.c (sim_open): Add argument processing to add the same
2280 switches main.c accepts for the standalone processor.
2281 (sim_close): Call psim_print_info if -I.
2283 * main.c (main): Add comment saying to update sim_calls.c when
2284 adding switches. Add -I to call psim_print_info when done.
2285 (usage): Update usage message.
2289 * main.c (printf_filtered): Correct to match new prototype.
2293 * sim_callbacks.h (printf_filtered): Correct prototype.
2297 * device_tree.c (OEA_MEMORY_SIZE): Define if not defined to
2299 (clayton_memory_size): Define as OEA_MEMORY_SIZE.
2301 * std-config.h (WITH_TRACE): Default to 1 now.
2303 * psim.c (write_stack_arguments): Don't write any stack arguments
2306 * main.c (main): Switch to using getopt. Make -p also set
2307 trace_semantics. Make -a turn on all trace flags. Make -C turn
2310 * device_tree.c (create_option_device_node): Assume a program is
2311 OEA if the start address is < 4096, not just == 0.
2315 * Makefile.in (maintainer-clean): New synonym for realclean.
2319 * registers.c (register_description): Add gdb synonyms for cr
2324 * Makefile.in (install): Don't install in $(tooldir).
2326 * configure.in: Call AC_CONFIG_HEADER. Don't try to use
2327 bfd/hosts/*.h file or bfd/config/*.mh file. Call AC_PROG_CC and
2328 AC_PROG_RANLIB. Substitute in values for CFLAGS, HDEFINES, AR,
2329 and CC_FOR_BUILD. Call AC_CHECK_HEADERS for various header files.
2330 Touch stamp.h if creating config.h.
2331 * configure: Rebuild.
2332 * config.in: New file, created by autoheader.
2333 * Makefile.in (AR): Define as @AR@.
2334 (CC): New variable, defined as @CC@.
2335 (CFLAGS): Define as @CFLAGS@.
2336 (CC_FOR_BUILD): New variable, defined as @CC_FOR_BUILD@.
2337 (RANLIB): Define as @RANLIB@.
2338 (HDEFINES, TDEFINES): New variables.
2339 (@host_makefile_frag@): Remove.
2340 (mostlyclean): Make the same as clean, not distclean.
2341 (clean): Remove config.log.
2342 (distclean): Remove config.h and stamp-h.
2343 (Makefile): Don't depend upon @frags@. Just rebuild Makefile when
2344 invoking config.status.
2345 (config.h, stamp-h): New targets.
2346 (gen, gen.o): Build with CC_FOR_BUILD, not CC.
2347 (ppc-config.h): Rename from old config.h build.
2348 * (basics.h,gen.c,ppc-endian.c,psim.c): Include ppc-config.h.
2352 * configure{,.in}: Don't include sysdep.h from bfd, since bfd no
2354 * basics.h (sysdep.h): Don't include it.
2355 * Makefile.in (BASICS_H): Remove sysdep.h.
2359 * core.c (core_add_data): First growth of bss was being put at
2360 wrong address (0) instead of &end.
2362 * core.c (core_add_stack, core_add_data): Was not handling case
2363 where bss/stack is grown across the current end-of-{bss,stack}.
2367 * system.c (system_call): Fix SYS_break - was aligning bss to a
2368 page boundary instead of just an 8 byte one; On first call sbrk(0)
2373 * Makefile.in (install): Fix install rule.
2377 * system.c (system_call): Add read support.
2379 * main.c (main): -t sets trace_device_tree. Correct usage message
2382 * device_tree.c (update_memory_node_for_section): Make tracing
2383 output line up. If not code or readonly, assume that the section
2384 is a data section and has read/write permissions. Add readonly
2387 * core.c (create_core_from_addresses): Print end address in traces
2388 and make tracing output line up.
2390 * Makefile.in: Rewrite from Makefile to work with the Cygnus
2391 environment, and support compiling in a different directory than
2392 the sources reside in.
2394 * ppc-endian.h: Rename from endian.h so that it doesn't get
2395 confused with /usr/include/sys/endian.h on Linux. Add Linux
2398 * ppc-endian.c: Rename to be consistant with ppc-endian.h.
2399 Include ppc-endian.h, not endian.h.
2401 * basics.h (sysdep.h): Include sysdep.h that configure makes.
2402 Include ppc-endian.h, not endian.h.
2404 * std-config.h: Rename from ppc-config. Put #ifndefs around most
2405 configuration macros, so they can be overridden via CFLAGS. By
2406 default, turn off tracing.
2408 * configure.in: Clone from other simulator targets.
2409 * configure: Generate via autoconf from configure.in.
2413 * ppc-instructions: fix srawi (was geting XER[CA] real wrong).
2415 * interrupts.c (data_storage_interrupt): allow stack to grow by
2416 upto one MB per increment.
2418 * ppc-instructions: divw was computing rA / rA not rA / rB
2420 * main.c (main): really stupid. Wasn't exiting with correct status
2424 * system.c (system_call): add system calls kill(2) and getpid(2).
2426 * main.c (main): Check/return exit status when simulation
2431 * device_tree.c (create_option_device_node): Alignment rules (at
2432 least for the moment) now are for strict alignment only for LE OEA
2433 mode. (Because of compiler problems).
2435 * system.c (system_call) SYS_exit: Wasn't exiting with correct status.
2439 * vm.c (DEFINE_VM_DATA_MAP_WRITE_N): For miss aligned transfer
2442 * system.c (system_call): didn't page align break argument before
2443 determining increment break increment.
2445 * psim/ppc: Re-arange entire directory structure so that
2446 everything lives in the one directory. While a pain for cleaning,
2447 makes building across multiple architectures much simpler.
2449 * devices.c, device_tree.c: Added code that provides a simple
2450 illustration of how an interrupt control device could be
2453 * devices.c: Added code so that the dumb console device can read
2454 (from stdin) as well as write to stdout.