3 * lf.c (lf_print__gnu_copyleft): Convert multiline strings to
5 * gen-idecode.c (print_run_until_stop_body): Likewise.
6 * gen-model.c (gen_model_c): Likewise.
10 * sim_calls.c (sim_fetch_register, sim_store_register): Return -1 for
11 AltiVec registers as a temporary stopgap.
15 * ppc/hw_disk.c: Export a disk device property.
20 * ppc-instructions (lswx): Do the register control with the
21 register count. Initialize the right register in the loop.
22 (mtfsfi) : Correct prefix for the instruction.
27 * std-config.h: Fix grammar and typos. Update copyright.
32 * Makefile.in (tmp-igen): Pass -I $(srcdir) to igen.
33 * igen.c (main): Change -I to add include paths for :include:
35 Implement -G as per sim/igen, with just gen-icache=N support.
36 Call load_insn_table() with the built include path.
38 * ld-insn.c (parse_include_entry): New. Load an :include: file.
39 (load_insn_table): New `includes' argument. Look for :include:
40 entries and call parse_include_entry() for them.
41 (main): Adjust load_insn_table() call.
42 * ld-insn.h (model_include_fields): New enum.
43 (load_insn_table): Update prototype.
44 * table.c (struct _open_table, struct _table): Rework
45 structures to handle included files.
46 (table_push): Move the guts of table_open() here.
48 * table.c (struct _open table, struct table): Make table object an
49 indirect ptr to the current table file.
50 (current_line, new_table_entry, next_line): Make file arg type
52 (table_open): Use table_push.
53 (table_entry_read): Point variable file at current table, at eof, pop
56 * misc.h (NZALLOC): New macro. From sim/igen.
58 * table.h, table.c (table_push): New function.
62 * bits.c (LSMASKED64): New inline function.
63 (LSEXTRACTED64): Likewise.
64 * bits.h (_LSB_POS, _LSMASKn, LSMASK64): New macros from
66 (LSMASKED64, LSEXTRACTED64): New functions definitions.
67 * Makefile.in (sim-bits.o): Remove target.
69 * main.c (zalloc): Fix typo in error message.
73 * configure.in (sim_fpu): Don't add sim-bits.o.
74 * configure: Re-generate.
78 * main.c: Include "defs.h", "bfd.h", "callback.h" and "remote-sim.h".
79 (sim_io_error): New function.
80 * sim_calls.c: (sim_io_error): New function.
84 * Makefile.in (LIB_OBJ): Add @sim_fpu@.
85 (ICACHE_CFLAGS, SEMANTICS_CFLAGS): New variables.
86 (icache.o, semantics.o): Add new ICACHE_FLAGS & SEMANTICS_FLAGS.
87 (sim-fpu.o, sim-bits.o, tconfig.h): New targets.
88 * configure.in: Rename INLINE_LOCALS to PSIM_INLINE_LOCALS. Add a
89 check for sim/common/sim-fpu.c. Output sim_fpu and sim_fpu_cflags.
90 * configure: Regenerate.
91 * device.h (device_find_integer_array_property): Match function definition.
92 * gen-icache.c (print_icache_internal_function_declaration): Rename
93 INLINE_ICACHE to PSIM_INLINE_ICACHE.
94 * gen-idecode.c (print_idecode_run_function_header): Rename INLINE_IDECODE
95 to PSIM_INLINE_IDECODE.
96 * gen-semantics.c (print_semantic_function_header): Rename
97 EXTERN_SEMANTICS to PSIM_EXTERN_SEMANTICS.
98 * gen-support.c (print_support_function_name): Rename INLINE_SUPPORT to
100 * igen.c (print_function_name): Also escape `(' and `)'.
101 (gen_semantics_h): Rename EXTERN_SEMANTICS to PSIM_EXTERN_SEMANTICS.
102 (gen_semantics_c): Likewise. Also output includes for "sim-fpu.h"
103 * inline.h (INLINE_SIM_ENDIAN): Renamed INLINE_PSIM_ENDIAN.
104 (EXTERN_SIM_ENDIAN): Renamed EXTERN_PSIM_ENDIAN.
105 (STATIC_INLINE_SIM_ENDIAN): Renamed STATIC_INLINE_PSIM_ENDIAN.
106 (INLINE_LOCALS): Renamed PSIM_INLINE_LOCALS.
107 (EXTERN_SUPPORT): Renamed PSIM_EXTERN_SUPPORT.
108 (INLINE_SUPPORT): Renamed PSIM_INLINE_SUPPORT.
109 (EXTERN_SEMANTICS): Renamed PSIM_EXTERN_SEMANTICS.
110 (INLINE_SEMANTICS): Renamed PSIM_INLINE_SEMANTICS.
111 (EXTERN_IDECODE): Renamed PSIM_EXTERN_IDECODE.
112 (INLINE_IDECODE): Renamed PSIM_INLINE_IDECODE.
113 (EXTERN_ICACHE): Renamed PSIM_EXTERN_ICACHE.
114 (INLINE_ICACHE): Renamed PSIM_INLINE_ICACHE.
115 * options.c (options_inline): Fix names.
116 * sim-endian-n.h: Change INLINE_SIM_ENDIAN to INLINE_PSIM_ENDIAN.
117 * sim-endian.h: Likewise.
118 * sim-main.h: New file.
119 * std-config.h: Rename INLINE_LOCALS to PSIM_INLINE_LOCALS.
124 * ppc-spr-table: Add SDA and PIR.
128 * tree.c (parse_size): Assert #size-cells > 0.
129 (parse_address): Ditto for #address-cells.
130 (parse_reg_property): Only parse the size when #size-cells is
135 * emul_generic.c (OEA_MEMORY_SIZE): Increase to 4mb.
136 * hw_htab.c (htab_map_binary): Don't try to map the text section
138 * emul_chirp.c (map_over_chirp_note): Default load-base to -1 not
140 (emul_chirp_create): Map in the interrupt table.
144 * Makefile.in: Add dependencies on $(CPU_H).
148 * hw_init.c (dma_file): Fixed problem with loading last 1KB of
153 * emul_netbsd.c [WITH_NetBSD_HOST]: Include <sys/mount.h> and
155 (do_stat): Only do SYS test when SYS_stat defined.
156 (do_sigprocmask): Ditto for SYS_sigprocmask.
157 (do_fstat): Ditto for SYS_fstat.
158 (do_getdirentries): Ditto for SYS_getdirentries.
159 (do_lstat): Ditto for SYS_lstat.
163 * emul_netbsd.c (do_open): Translate the flag parameter to the
164 open syscall to the numbers supported by the host.
168 * sim-endian.h: Don't have parameters on macro definitions which
169 are simply renaming functions, to permit use of XCONCAT2 in both
170 the macro name and the arguments in a use of such a definition.
174 * sim_calls.c: Doc fix.
175 (sim_fetch_register, sim_store_register): Call
176 gdbarch_register_name directly, instead of going through
181 * ppc-instructions (lfsux): Correct XO field of lfsux instruction.
185 * configure: Regenerated to track ../common/aclocal.m4 changes.
189 * events.c (event_queue_process): Call update_time_from_event
190 every time an event is removed from the queue.
191 (update_time_from_event): Delete assertion that a negative
192 time_from_event implies an empty event queue.
196 * interrupts.c (deliver_hardware_interrupt): Print time trace in
198 * events.c (event_queue_process): Cleanup trace message.
199 (update_time_from_event): Trace full event queue.
203 * ppc-instructions (Disabled_Exponent_Underflow): Increment
204 the exponent when denormalizing.
208 * configure: Regenerated to track ../common/aclocal.m4 changes.
212 * configure.in: Use AC_EXEEXT instead of AM_EXEEXT.
213 * configure: Regenerated to track ../common/aclocal.m4 changes.
217 * sim_calls.c (POLL_QUIT_INTERVAL): Define. Used to tweak
218 the frequency at which the poll_quit callback is called.
219 (poll_quit_count): New global.
220 (sim_io_poll_quit): Only call the poll_quit callback
221 after the specified POLL_QUIT_INTERVAL.
225 * dc-complex: Force expansion on all bits of field BO.
226 Previously, the least-significant (prediction) bit was ignored.
227 * ppc-instructions (conditional branches): Implement mpc860c0 option.
228 * igen.c (gen_semantics_[ch]): Setup for mpc860c0 option.
229 * psim.c (is_num, psim_options): Added parsing for mpc860c0 option.
230 * interrupts.h: Added "mpc860c0_instruction_program_interrupt".
231 * interrupts.c (program_interrupt): Added handling for above interrupt.
235 Make the simulator compatible with the MPC750. It would be nicer
236 to make this a real multi-sim, but that's more work than we have
238 * emul_generic.c (emul_add_tree_options): Only require strict
239 alignment if it was explicitly requested at configuration time.
240 Don't make it the default for little-endian machines.
241 * ppc-spr-table (UMMCR0, UMMCR1, UPMC1, UPMC2, USIA, UPMC3, UPMC4,
242 MMCR0, PMC1, PMC2, SIA, MMCR1, PMC3, PMC4, L2CR, ICTC, THRM1,
243 THRM2, THRM3): Plop in the MPC750 SPR registers.
244 (DABR): This is weird. This was HID5, but the PPC spec says this
245 should be DABR; why did some random processor use it for something
246 else? The HID5 entry dates back to the original checkin of the
247 simulator code in 1995, so remove it.
248 * sim_calls.c (register_names): Delete this; since the user can
249 now change GDB's list of register names dynamically, we can't
250 pretend there's a static mapping here.
251 (sim_fetch_register, sim_store_register): Call GDB's REGISTER_NAME
252 function to get the register name. That ought to be accurate.
253 However, we're changing a compile-time dependency (using the
254 REGISTER_NAMES macro) into a link- and run-time dependency
255 (calling REGISTER_NAME, which happens to be a function call on the
260 * igen.c(gen_semantics_[ch]): setup/use of new option
262 interrupts.[ch](mpc860c0_instruction_program_interrupt): added.
263 ppc-instructions(the four branch insn groups): detect problematic br's.
264 psim.c(is_num - added, psim_options): Parse and init new option.
265 These changes are currently under #ifdef WITH_OPTION_MPC860C0.
269 * hw_nvram.c (hw_nvram_bcd): Force value to fit in 0..99.
273 * main.c (sim_io_poll_quit): Stub function.
275 * events.c (SIM_EVENTS_POLL_RATE): Define.
276 (sim_events_poll): Copy function from common/sim-events.c.
277 (event_queue_init): Copy scheduling of sim_events_poll from same.
279 * sim_callbacks.h, sim_calls.c (sim_io_poll_quit): New function,
280 poll the external environment.
284 * ppc-instructions (is_{NaN,inf}): Use unsigned64 to get the
285 fractional type, so that quiet NaN's aren't treated like
290 * table.c (table_open): For cygwin hosts, we need to use the
291 return value from the read routine as the number of bytes to
292 process. This apparently is due to text-mode vs binary-mode. If
293 the mounts are done text-mode, then the size returnedby fstat()
294 may be different than the number of bytes "read" in text mode.
298 * emul_netbsd.c (do_open): fix order-of-evaluation problem.
305 * emul_{netbsd,unix}.c: Update copyright year.
309 * sim_calls.c (sim_fetch_register, sim_store_register):
310 return zero when nothing to do.
314 * configure.in (AC_CHECK_HEADERS): Don't check for sys/mount.h.
315 * configure: Regenerate.
316 * emul_{netbsd,unix}.c (toplevel): No longer try to include
317 sys/mount.h. It conflicts on Linux when gnu libc2 is used.
321 * Makefile.in: The run target depended on a target psim$(EXEEXT),
322 but there was no such target, only plain psim. So I changed the
323 run target to depend on psim.
327 * aclocal.m4: Remove defs of AM_EXEEXT and AM_CYGWIN32. These are
328 now defined in ../common/aclocal.m4, and the double definition causes
329 problems with AC_SUBST of EXEEXT.
330 * configure: Regenerate.
334 * aclocal.m4: new file for AM_EXEEXT macro
335 * configure.in: call AM_EXEEXT
336 * configure: regenerate with autoconf 2.12.1.
337 * Makefile.in: add EXEEXT support
339 Sun Apr 26 15:31:55 1998 Tom Tromey <tromey@creche>
341 * configure: Regenerated to track ../common/aclocal.m4 changes.
346 * acconfig.h: New file.
347 * configure.in: Reverted change of Apr 24; use sinclude again.
348 Don't call AC_C_CROSS.
350 Fri Apr 24 14:16:40 1998 Tom Tromey <tromey@creche>
352 * configure: Regenerated to track ../common/aclocal.m4 changes.
357 * Makefile.in (top_builddir): New macro.
358 (INTLLIBS): New macro.
359 (INTLDEPS): Likewise.
360 (psim): Depend on INTLDEPS; link against INTLLIBS.
361 * configure.in: Call CY_GNU_GETTEXT.
365 * configure: Regenerate with autoconf 2.12.1.
369 * psim.c (psim_read_register, psim_write_register): Handle updates
372 * registers.c (register_description): Reconize "FPSCR".
374 * emul_netbsd.c (emul_netbsd_create): When FP available, enable
375 MSR FP exception mode. Do not enable FPSCR bits.
376 * emul_unix.c (emul_unix_create): Ditto.
380 * sim_calls.c (sim_store_register, sim_fetch_register): Pass in
381 length parameter. Return -1.
385 * ppc-instructions (fdiv, fdivs): Check for divide by zero.
386 (is_invalid_zero_divide, invalid_zero_divide_operation): New
391 * sim_calls.c (sim_load): Do not parse PROG using buildargv, use
396 * emul_chirp.c: #ifdef HAVE_UNISTD_H
400 * corefile.c (core_attach): Pad out allocated memory regions so
401 that they are always correctly aligned.
402 (struct _core_mapping, core_map_attach, core_init,
403 new_core_mapping): Change free_buffer to type void*.
407 * sim_calls.c (zfree): Call free correctly.
411 * sim_calls.c (zfree): Use free, not mfree.
412 (sim_io_flush_stdoutput): Replace gdb_flush with callback ->
417 * ppc-instructions (sraw, slw, srw): From Charles Lefurgy, Fix
418 mask extracting shift amount. Correctly condition for setting XER
420 (ldhau): From Johannes Reisinger, update rA after load.
424 * basics.h (CONCAT*): token-pasting macros, if ALMOST_STDC,
426 * words.h: __int64 instead of long long for MSVC.
430 * sim_calls.c (sim_create_inferior): Check the simulator was
431 initialized before creating inferior.
433 * idecode_expression.h (ALU_END): From Charles Lefurgy - Extract
434 sign bit using 64 bit and not a 32 bit mask.
438 * sim_calls.c (sim_load): From Ian Lance Taylor - free argv after
439 it has been used, not before.
443 * sim_calls.c (sim_kill): Delete.
444 (sim_create_inferior): Add ABFD argument.
445 (entry_point): Delete variable.
446 (sim_load): Move setting of PC from here.
447 (sim_create_inferior): To here.
451 * sim_calls.c (sim_open): Add ABFD argument.
455 * ppc-instructions (PPC_INSN_INT): From Michael Thies - Monitoring
456 CR register updates dependant on RC value had logic backwards.
458 * ppc-instructions (Load String Word Immediate): From Brad Parker
459 - sense of wrap test in check for overwriting RA wrong.
460 (Load String Word Indexed): Ditto.
462 * configure.in: From Erik Landry - set sim_default_model not
463 sim_model for sim-default-model option.
464 * configure: Regenerate.
466 * interrupts.c (check_masked_interrupts): Schedule a hardware
467 interrupt delivery when FP interrupts get enabled.
468 (program_interrupt): Generate FP exceptions instead of aborting.
469 (deliver_hardware_interrupt): Deliver a FP exception if so
472 * registers.h: Add definition of fpscr_vx_bits.
474 * idecode_expression.h (FPSCR_END): Always update FEX and VX bits
476 (FPSCR_END): Explicitly check for possible floating point
477 exception conditions.
478 (FPSCR_BEGIN): Simplify.
480 * ppc-instructions (Move From FPSCR): Enable.
481 (Move To FPSCR Bit 1): Ditto.
482 (Move To FPSCR Bit 0): Ditto.
483 (Move To FPSCR Field Immediate): Ditto.
484 (Move to Condition Register from FPSCR): Simplify.
485 (invalid_arithemetic_operation): Generate a QNaN when invalid
486 operation exception disabled.
490 * sim_calls.c (sim_open): Add callback argument.
491 (sim_set_callbacks): Delete.
495 * sim_callbacks.h (error): Make declaration match gdb's.
496 * main.c (error): Ditto.
500 * sim_calls.c (sim_stop_reason): Simplify. Was running implies
501 stopped/SIGINT. Exit implies a status code.
503 * psim.c (cntrl_c_simulation): From main.c. Event function that
505 (psim_stop): New. Asynchronously schedule a stop simulator event.
506 (psim_run_until_stop): Delete. Made redundant by psim_stop.
508 * main.c (cntrl_c): Update.
509 (cntrl_c_simulation): Moved to psim.c.
511 * sim_calls.c (sim_stop): New function. Use psim_stop which
512 schedules a stop event.
513 (sim_resume): Drop SIGINT handler, now in gdb/main.c.
514 (sim_resume): Use psim_run as stop variable no longer needed.
518 * psim.c (psim_options): Handle -E option correctly.
519 (psim_usage): Document.
523 * psim.c (psim_options): Ignore -E option (sets endianness).
524 * sim_calls.c: #include bfd.h.
525 (entry_point): New static local.
526 (sim_load): Return SIM_RC. New arg abfd. Set start address from bfd.
527 (sim_create_inferior): Return SIM_RC. Delete arg start_address.
531 * Makefile.in (INSTALL): Set to @INSTALL@.
532 (INSTALL_XFORM, INSTALL_XFORM1): Remove.
533 (install): Depend upon installdirs. Use $(program_transform_name)
534 directly, rather than using $(INSTALL_XFORM).
535 (installdirs): New target.
539 * Makefile.in (tmp-hw, tmp-pk): Use for loop to eliminate duplicates
540 rather than the non-portable cat -n.
544 * Makefile.in (INSTALL): Change install.sh to install-sh.
548 * ppc-instructions: Change milhwu to mulhwu.
552 * sim_calls.c (sim_open): New arg `kind'.
556 * COPYING: Update FSF address.
560 * main.c (sim_io_read_stdin): Only compile unbuffered IO code if
561 all the required features are supported by the host OS.
565 * emul_bugapi.c (emul_bugapi_create): Guard against NULL images.
567 * configure.in (enable-sim-endain): Correct typo in usage (from
569 * configure: Re-generate.
573 * Makefile.in (targ-vals.def): Re-do rule so that it works with
574 FreeBSD's make. Didn't like $<.
578 * sim_calls.c (sim_open): New SIM_DESC result. Argument is now
580 (other sim_*): New SIM_DESC argument.
584 * ppc-opcode-simple-array, ppc-opcode-simple-goto,
585 ppc-opcode-simple-switch, ppc-opcode-complex-array,
586 ppc-opcode-complex-goto, ppc-opcode-complex-switch,
587 ppc-opcode-jump, ppc-opcode-goto, ppc-opcode-flat: Delete,
588 superseeded by --sim-decode-mechanism option.
590 * ppc-opcode-simple, dc-simple: Rename to be 8.3
591 * ppc-opcode-complex, dc-complex: Ditto.
592 * ppc-opcode-stupid, dc-stupid: Ditto.
593 * ppc-opcode-test-1, dc-test.01: Ditto.
594 * ppc-opcode-test-2, dc-test.02: Ditto.
596 * configure.in (--enable-sim-opcode): Change prefix to dc- instead
601 * Many of the ppc-opcode-* files are identical baring the type of
602 lookup table. Instead of having multiple tables, igen can do this
603 via an additional option.
605 * ld-decode.h, ld-decode.c (force_decode_gen_type): New function,
606 allow the type of generated table specified in the decode file to
609 * ld-decode.c (load_decode_table): Allow the table type to be
612 * igen.c (main): Add -T <mechanism> option so that an overriding
613 instruction decode mechanism can be specified.
615 * configure.in: New option --sim-decode-mechanism to control
616 igen's new -T <mechanism> flag.
617 * Makefile.in (IGEN_FLAGS): Add IGEN_IDECODE_MECHANISM set by the
619 * configure: Regenerate.
623 * events.c (event_queue_create): Don't use NULL to initialize an
625 (even_queue_{init,schedule_after_signal,tick}): Conditionalize use
626 of sigprocmask to appropriate autoconf test.
628 * main.c ({cntrl_c,main}): Use RETSIGTYPE for signal return type,
630 * sim_calls.c (sim_{ctrl_c,resume}): Ditto.
632 * Makefile.in (callback.o): Define HAVE_CONFIG_H, so callback.c
633 includes our config.h.
637 * configure.in: Fix typo in test for callback.c.
638 * configure: Regenerated.
642 * emul_chirp.c (emul_chirp_create): Handle a virtbase of -1 being
643 found in the device tree.
647 * Property create/initialization still wasn't correctly ordered.
648 Should be delaying everything related to ihandle creation until
649 after the rest of the tree has been established.
651 * device.c (device_find_ihandle_runtime_property): Update.
652 (device_add_ihandle_runtime_property): Update.
654 * tree.c (parse_ihandle_property): Delay lookup of the device to
655 be opened until the ihandle initialization phase.
656 * tree.c (print_properties): Update.
660 * gen-icache.c (print_icache_extraction): Add a reason parameter.
661 Augment each extracted field with a comment citing the codes
662 origin. Should simplify tracking down incorrect cache
667 * gen-icache.c: Generalize code handling XXX_is_NNN so that it
668 works for normal and boolean table entries.
670 * psim.c (psim_write_memory): last_cpu == -1 or nr_cpus is now
671 valid. Handle this just like *_{read,write}_register now handles
676 * events.c (insert_event_entry): Correct loop termination
681 * psim.c (psim_options): Add new option -c for max-iterations or
683 (psim_usage): Document.
684 (psim_max_iterations_exceeded): New function, abort simulation if
685 max iterations exceeded.
687 * gen-idecode.c: Re-work the table lookup code so that it assumes
688 that the entry is a leaf by default. Simplify the boolean table
689 entry code so that it involves a mask + test instead of shift +
692 * gen-idecode.c: Correct generated igen body so that it no drops
693 or doubles clock interrupts.
698 * Makefile.in (BUILT_SRC_WO_CONFIG): Change targ-vals.* to
701 * configure.in (sim_callback, sim_targ_vals): Set sim_targ_valls
702 if common callback is present.
706 * configure.in (sim_callback): If the gdb is post 4.16, configure
707 callback support from the common directory.
708 * configure: Regenerate.
710 * Makefile.in (BUILT_SRC_WO_CONFIG): Add targ-vals.{h,def} and
712 (GDB_OBJ): Add callback support configured in.
713 (gentmap,targ-vals.def): Build from common directory.
714 (targ-vals.h,targ-map.c): Build by running gentmap.
715 (callback.o): Build from source in common directory.
716 (targ-map.o): Add dependency.
717 (clean): Remove gentmap.
721 * igen wasn't aborting if the opcode table contained no valid
724 * misc.c (name2i): Possibly abort if an invalid name is
726 * ld-decode.c: Abort if the table type isn't found.
730 * When performance monitoring is disabled, it is still possible to
731 determine the simulation speed by looking at the number of elapsed
732 ticks recorded by the event queue.
734 * psim.c (psim_write_register, psim_read_register): Force the cpu
735 to zero when it is either of `-1' or `nr_cpus'. In both cases the
736 next cpu would be zero any way.
738 * mon.c (mon_print_info): If possible, print the system cycle
739 performance. This is an indication of the number of instructions
744 * The code to allow an event queue to be updated during a signal
745 was missing. For main.c, a cntrl-c simulation termination wasn't
748 * The simulation would not correctly restart if an event requested
749 that the simulation be halted.
751 * psim.c (psim_options): Add hack to -i option to optionally
752 include a level vis -i2.
753 (psim_usage): Document.
755 * main.c (cntrl_c, cntrl_c_simulation): New functions. When a
756 cntrl-c occures schedule an event to halt the simulation.
757 (main): Catch CNTRL-C signals with the function cntrl_c.
759 * events.c (event_queue_process): Mask interrupts while
760 manipulating the async event queue.
761 (event_queue_init): Ditto.
762 (event_queue_schedule_after_signal): Ditto.
764 * events.c (event_queue_process): Mark the event queue as being in
765 the processing state when processing has started. Adjust code
766 so that it is tolerant of halts.
767 (event_queue_init): Start the event queue out with processing
769 (event_queue_tick): Check that processing isn't still being
772 * gen-idecode.c (print_run_until_stop_body): Call
773 event_queue_process_events to clear possibly pending events before
774 starting a simulation run. Re-arange main loop so that simulator
775 is correctly restarted when an event halts the simulation.
777 * psim.c (psim_halt): Handle an event halting the simulation.
778 * psim.c (psim_init): Adjust initial cpu - == -1 - to match
783 * ppc-opcode-complex: Correct typo - was expanding ORA instead of
784 RA. Based on instruction frequency stats, expand additional
786 * ppc-instructions: Change all `RA == 0' to RA_is_0.
788 * ppc-opcode-stupid: Move all but the basic table in -complex into
789 here. Update to new format.
791 * Makefile.in (tmp-defines): New target. Force defines.h to always
792 be built. Hence get ppc-opcode-goto to build.
796 * hw_com.c (hw_com_instance_read, hw_com_instance_write):
801 * hw_trace.c (hw_trace_init_data): Delete. The trace options need
802 to be initialized independant of the rest of the simulation
803 initalization. Otherwize a trace option explictly set from gdb
804 could be overridden by hw_trace.
806 * psim.c (psim_options): Clarify reason why the trace ioctl occures.
808 * FIXME: The trace code is too scattered - hw_trace.c, psim.c,
809 debug.c. It could be much simpler.
813 * Some devices support removable media. Add hooks to the disk
814 device so that it supports this.
816 * device.c (device_add_string_array_property,
817 device_find_string_array_property): New functions, manipulate
818 properties containing an array of strings.
819 (device_find_string_property): Allow a string array.
820 (device_init_static_properties): Update.
821 (device_init_runtime_properties): Update.
823 * hw_disk.c (hw_disk_ioctl): Add ioctl for changing the disk
824 media. If no file image is specified, use the next one in the
826 (hw_disk_init_address): Change the file property so that it is a
827 string array - use the first entry for the initial file image.
829 * tree.c (print_string_aray_property): New function - print a
831 (print_properties): Adjust.
832 (print_string): Write a string, handling double quotes.
834 * device.h: Define an ioctl to `change-media' with an optional new
837 * hw_disk.c: Allow floppy disk devices to be specified.
839 * psim.c (psim_command): New function, parse more complex psim
840 commands such as "change-media" and "trace".
841 * sim_calls.c (sim_do_command): Use.
845 * For expressions like (RA == 0) that are entered in to the cache
846 as RA_is_0. If possible generate the result of the expression so
847 that the compiler gets a better chance of eliminating dead
850 * gen-icache.c (print_icache_extraction): For a cache entry of
851 the form <name>_is_<const> where it is a boolean field, generate
852 the result of the expression instead of the expression its self.
853 (print_icache_body): Remove code that was looking for *_is_0 and
854 then generating corresponding definitions.
856 * gen-icache.c (print_icache_struct): If there is no cache, do not
857 output expressions in idecode.h file.
859 * gen-icache.c (print_icache_body): Output them here.
861 * ppc-opcode-complex: Clarify constant values for SPR==LR register
864 * ppc-cache-rules (RA_is_0, SPR_is_256): Two new cache entries.
868 * The code that put values in and extracted values from the cache
869 was too compilicated. The cache table did not allow values to be
870 computed from cache entries. #defines could only be used when a
871 cache was present, remove the restriction.
873 * ld-cache.h, ld-cache.c: Add a new cache entry type - SCRATCH. A
874 scratch variable is defined when a cache entry is beinf
875 filled. Change the definition of a COMPUTE variable to be defined
876 when the cache entry is being used.
877 * gen-icache.c: Update.
879 * ld-cache.h, ld-cache.c: Change field names so that their meaning
880 is more obvious. old_name->field_name, new_name->derived_name.
881 * gen-icache.c: Update
883 * gen-icache.h, gen-icache.c (print_icache_body): Make the three
884 different types of cache code - put into cache, extract from
885 cache, no cache - an explicit argument to print_icache_body.
886 * gen-icache.c (print_icache_extraction): Ditto.
888 * gen-semantics.c (print_c_semantic): Update use.
889 * gen-idecode.c (print_jump_insn): Update use.
890 * gen-icache.c (print_icache_function): Update use.
892 * igen.c (main): Change 'R' option so that it does not force the
895 * configure.in (enable-sim-icache): Clarify description. Make
896 #define one of the defaults regardless of the cache. Probably
897 should revamp and add a separate option.
901 * pk_disklabel.c (block_is_fdisk): Tidy up traces - use dos
903 (pk_disklabel_create_instance): Partition 1..4 are valid - not
905 (is_iso9660): New function, verify a CD9660 File system.
906 (pk_disklabel_create_instance): Start expanding so that active
907 partition selection is supported.
911 * The cap object was retaining a reference to the instance of a
912 device after it was deleted. Instead add and remove cap's from the
913 cap db as they are created and deleted. This ensuring that a
914 capibility is only used during the lifetime of the corresponding
917 * cap.h, cap.c: Correct cap type - was signed32 should be
920 * cap.c (cap_add, cap_remove): New methods for cap object that
921 allow the explicit addition and removal of internal objects that
924 * cap.c (cap_init): Rewrite. Verify that the only objects
925 remaining in the cap data base are those that were entered first.
926 Thse objects will be the permenant ones.
927 * device.c (device_init_address): Remember to initialize the cap
930 * device.c (device_create_instance_from): Explicitly add device
931 instances to the cap database. Simplify create code.
932 (device_instance_delete): Explicitly remove device instances from
935 * device.c (device_create_from): Explicitly add a device to the
938 * device.c (device_create_from): Always set the cap members.
940 * hw_disk.c: Output the instance when tracing.
944 * tree.c (split_device_specifier): Add support for aliases when
945 looking up a device. Now needs a device as an argument.
946 (split_property_specifier): Ditto.
950 * The memory "claim" and "release" methods take an address and
951 size as arguments. These may be multi cell values. Initially fix
952 the memory code so that they check/detect this. Leave the
953 adjustment of any clients to later.
955 * hw_memory.c (hw_memory_instance_claim,
956 hw_memory_instance_release): Handle multi-cell memory devices.
958 * hw_memory.c (hw_memory_instance_claim): Be tolerant towards the
959 release of memory regions that were not claimed.
963 * device.h, device.c (device_instance_call_method): Correct return
964 type - can return either 0 or -1, hence should be a signed type.
965 * device_table.h: Ditto.
967 * hw_memory.c (hw_memory_instance_claim,
968 hw_memory_instance_release): Update.
969 * hw_disk.c (hw_disk_max_transfer, hw_disk_block_size,
970 hw_disk_nr_blocks): Ditto.
974 * emul_chirp.c (chirp_emul_claim): Implement using the "claim"
975 method belonging to "/chosen/memory".
976 (chirm_emul_release): Ditto.
978 * Makefile.in (LIB_INLINE_SRC): Remove emul_* from list of files
979 that are inlined. These modules are called via a table and are
982 * hw_init.c (update_for_binary_section): Fix failure to allocate
983 memory used by the binary in real-mode executions. If "claim"
984 property is present, allocate memory from the "/chosen/memory"
987 * emul_chirp.c (emul_chirp_create): Specify that memory should be
988 claimed when loading a real image.
990 * hw_memory.c (hw_memory_instance_claim): Don't page align memory
993 * hw_memory.c (hw_memory_instance_release): Avoid infinite loop
994 when merging adjacent memory chunks.
998 * vm.h (vm_data_map_read_buffer, vm_data_map_write_buffer): Add
999 optional PROCESSOR & CIA args so that this routine also abort an
1002 * vm_n.h (vm_data_map_read_N, vm_data_map_write_N): For a
1003 miss-aligned access when a transfer fails abort.
1005 * emul_bugapi.c (emul_bugapi_do_write): Use emul_read_buffer
1006 instead of the vm_read_buffer.
1007 * emul_netbsd.c (do_write): Ditto.
1008 * emul_unix.c (do_unix_write): Ditto.
1012 * configure.in (--enable-sim-jump): Default is NULL and not -E.
1013 * configure: Regenerate.
1015 * basics.h (__attribute__): Enable attributes if GCC >= 2.6.
1016 (UNUSED): Only enable UNUSED if GCC >= 2.7.
1018 * gen-icache.c (print_icache_extraction): Print UNUSED macro
1019 instead of explicit __unused__ attribute.
1020 (print_icache_body): Ditto.
1021 * idecode_expression.h (FPSCR_BEGIN): Use UNUSED.
1025 * cpu.h, cpu.c (cpu_synchronize_context): Add CIA argument as
1028 * vm.c (vm_synchronize_context): Add PROCESSOR and CIA as
1029 arguments so that there is a reference point for recovery.
1030 (vm_synchronize_context): Pass processor+cia for errors.
1031 (om_unpack_sr): Ditto.
1032 (om_unpack_srs): Ditto.
1033 * vm.c (vm_create): Review error messages.
1035 * vm.c: Include "cpu.h" so that cpu_error is visible.
1037 * ppc-instructions (Return From Interrupt): Pass CIA.
1038 (Instruction Synchronize): Ditto.
1039 * psim.c (psim_init): Ditto.
1043 * cpu.h, cpu.c (cpu_error): Aborts simulation with error message,
1044 but also saves current processor state.
1046 * basics.h: Move #include <stdarg.h> to here from device_table.h.
1048 * interrupts.c (perform_oea_interrupt): Use. No longer loose CIA
1049 when simulation aborted.
1050 (program_interrupt): Ditto.
1051 (floating_point_unavailable_interrupt): Ditto.
1052 (alignment_interrupt): Ditto.
1053 (floating_point_assist_interrupt): Ditto.
1054 (perform_oea_interrupt): Ditto.
1055 (machine_check_interrupt): Ditto.
1059 * ppc-instructions (Move from Special Purpose Register): Support
1064 * debug.h, debug.c: Add "interrupts" trace option.
1066 * interrupts.c (data_storage_interrupt): Add tracing.
1067 (machine_check_interrupt): Ditto.
1068 (instruction_storage_interrupt): Ditto.
1069 (alignment_interrupt): Ditto.
1070 (program_interrupt): Ditto.
1071 (floating_point_unavailable_interrupt): Ditto.
1072 (system_call_interrupt): Ditto.
1073 (floating_point_assist_interrupt): Ditto.
1074 (deliver_hardware_interrupt): Ditto.
1076 * interrupts.c (program_interrupt): For UEA mode, halt the
1077 processor - so that the current state is saved - instead of
1079 (floating_point_unavailable_interrupt): Ditto.
1080 (floating_point_assist_interrupt): Ditto.
1084 * interrupts.c (perform_oea_interrupt): Halt rather than abort on
1089 * ppc-instructions (Store Multiple Word, Load Multiple Word):
1092 * tree.c (print_properties): For an array consider printing it out
1093 as an integer array.
1095 * hw_memory.c (hw_memory_init_address): If an "available" property
1096 is present, use that to initialize the available memory instead of
1097 using the reg property.
1099 * emul_generic.c (emul_add_tree_hardware): Add "available"
1100 property to memory device.
1104 * ppc-instructions (Rotate Left Word then AND with Mask): Enable.
1106 * device.c (device_instance_call_method): Was only looking at the
1109 * hw_disk.c (hw_disk_nr_blocks): Implement #blocks method.
1110 (hw_disk_block_size): Implement block-size method.
1111 (hw_disk_max_transfer): Implement max-transfer method.
1113 * hw_phb.c (hw_phb_init_address): Reinit the rest of the PHB.
1115 * emul_chirp.c (chirp_emul_instance_to_path): Recover from an
1117 (chirp_emul_instance_to_package): Ditto.
1118 (chirp_emul_method): Ditto.
1119 (chirp_emul_read): Ditto.
1120 (chirp_emul_write): Ditto.
1121 (chirp_emul_close): Ditto.
1122 (chirp_emul_seek): Ditto.
1123 (chirp_emul_package_to_path): Ditto (for phandle).
1124 (chirp_emul_package_to_path): Return the length.
1126 * psim.c (psim_merge_device_file): Allow continuation lines.
1130 * emul_chirp.c (chirp_emul_boot): Implement. Well report the new
1133 * emul_chirp.c (chirp_emul_exit): Correct type of args struct
1134 members - *_cell not host dependant int.
1138 * interrupts.c (perform_oea_interrupt): Print additional
1139 information if a double interrupt is encountered.
1143 * psim.c (psim_merge_device_file): Tolerate an incorrect file-name
1144 being specified with the -f option.
1145 (psim_merge_device_file): Correct check for end of string.
1149 * emul_chirp.c (chirp_emul_peer): Was falling off the end of the
1150 list of devices. Return zero to the client instead.
1151 * emul_chirp.c (chirp_emul_child): Ditto
1152 * emul_chirp.c (chirp_emul_parent): Ditto
1154 * device.c (device_root): Assert assumption about the device being
1159 * emul_chirp.c (emul_chirp_create): Add description property to
1160 each significant node in the device tree.
1161 * emul_bugapi.c (emul_bugapi_create): Ditto.
1165 * main.c (sim_io_read_stdin): For a single byte STDIO read, use a
1166 tempoary two byte buffer. Single byte read with fgets will not
1168 * main.c: Include errno.h.
1169 (sim_io_read_stdin): For non-STDIO, make it work.
1171 * emul_chirp.c (chirp_emul_read): Return the correct error status.
1175 * std-config.h (WITH_STDIO): Don't hard-wire the STDIO mechanism.
1176 Instead have each emulation default it to DO_USE_STDIO.
1178 * emul_generic.c (emul_add_tree_options): Select the STDIO I/O
1179 mechanism as the default if enabled or if nothing selected.
1181 * sim_calls.c (sim_io_read_stdin): Passify GCC's desire for a
1183 (sim_io_write_stdout): Ditto.
1184 (sim_io_write_stderr): Ditto.
1185 * main.c (sim_io_write_stdout): Ditto.
1186 (sim_io_write_stderr): Ditto.
1187 (sim_io_read_stdin): Ditto.
1191 * emul_chirp.c (emul_chirp_instruction_call): Make *printf calls
1193 * vm.c (om_effective_to_virtual): Ditto.
1194 * events.c (event_queue_schedule{,_after_signal}): Ditto.
1195 (event_queue_{deschedule,process}): Ditto.
1196 * hw_htab.c (htab_decode_hash_table): Ditto.
1197 (htab_map_{page,binary}): Ditto.
1198 * hw_opic.c (hw_opic_init_data): Ditto.
1199 (handle_interrupt): Ditto.
1200 (do_processor_init_register_{read,write}): Ditto.
1201 (write_vector_priority_register): Ditto.
1202 ({read,write}_destination_register): Ditto.
1203 (do_suprious_vector_register_{read,write}): Ditto.
1204 (do_current_task_priority_register_N_{read,write}): Ditto.
1205 (do_timer_frequency_reporting_register_{read,write}): Ditto.
1206 (do_timer_N_{current,base}_count_register_{read,write}): Ditto.
1207 (do_ipi_N_dispatch_register_write): Ditto.
1208 (do_vendor_identification_register_read): Ditto.
1209 (do_feature_reporting_register_N_read): Ditto.
1210 (do_global_configuration_register_N_{read,write}): Ditto.
1211 * hw_phb.c (hw_phb_attach_address): Ditto.
1212 (hw_phb_unit_decode): Ditto.
1213 (hw_phb_address_to_attach_address): Ditto.
1214 (hw_phb_io_{read,write}_buffer): Ditto.
1215 * hw_ide.c (setup_fifo): Ditto.
1217 * sim_calls.c ({defs,callback,remote-sim}.h): Find gdb include
1218 files via -I<dir> instead of using "../../gdb/" prefixes.
1222 * debug.h: Add tracing for the pal device.
1225 * emul_chirp.c (chirp_emul_getprop): More tracing.
1229 * device.h, device.c (device_find_ihandle_runtime_property): New
1230 function. Reverse of add_ihandle_runtime property.
1231 (device_init_runtime_properties): Use it.
1233 * device.c (find_property_entry): New function returns the
1234 internal property spec.
1235 (device_set_property): Use.
1236 (device_find_property): Use.
1240 * psim.c (psim_merge_device_file): Strip newline from device
1245 * hw_htab.c (htab_map_binary): For overlapping text / data maps
1246 merge the two. Also check that the merge is safe.
1248 * emul_chirp.c (emul_chirp_create): Add a description property to
1249 the pte's so that they are easier to identify.
1251 (emul_chirp_create): Don't specify a load address for the CHRP
1252 image. Always use the values specified by the executable.
1254 * hw_htab.c (htab_map_page): Abort if a duplicate map is
1259 * hw_htab.c (htab_map_page): Formatting.
1261 * emul_chirp.c (emul_chirp_instruction_call): Check for a NULL
1262 method name when handling the client call. Also check for other
1265 * emul_chirp.c (emul_chirp_create): Allow real-mode?, real-base,
1266 etc to be overriden.
1270 * os_emul.c (os_emul_create): Use tree find property instead of
1271 device find property - sigh.
1275 * 961205: Release snapshot 961205.
1279 * configure.in (hostbitsize, bitsize): Fix typo in error message -
1280 cannot contain a comma.
1281 (sim-warnings): Check for more potential errors.
1283 * psim.c (psim_usage): Add -f <file> option. Specifies a file
1284 containing device tree specifications that should be merged into
1287 * configure.in: Sort options.
1288 * configure: Rebuild
1292 * psim.c (psim_usage): Add -n option - specify number of
1295 * emul_chirp.c: Add description.
1296 * emul_bugapi.c: Ditto.
1297 * emul_unix.c: Ditto.
1298 * emul_netbsd.c: Ditto.
1302 * hw_pal.c (hw_pal_attach_address): New function, if an attach is
1303 encountered, assume that it is the single disk.
1304 * hw_pal.c: Add generic device/size decode methods.
1306 * hw_nvram.c (hw_nvram_init_address): Use the first nonzero reg
1307 property entry when determining the nvram size.
1309 * hw_core.c: Add generic address/size decode methods.
1311 * emul_chirp.c (emul_chirp_instruction_call): Return and trace
1312 nonzero status from client functions.
1314 * main.c (error): Always include a cariage return when writing out
1319 * sim_calls.c (sim_resume): Reset sim_should_run if single
1324 * emul_bugapi.c (emul_bugapi_do_diskio): Add support for multiple
1327 * emul_generic.c (emul_add_tree_hardware): Drop the dummy eeprom.
1328 Attach the pal - for I/O - as a pseudo device haning from the
1331 * emul_bugapi.c (emul_bugapi_create): Add a small memory device to
1332 the device tree at the address of the hi-mem interrupt vector
1333 addreses. Used by bugapi to establish its trap instructions.
1335 * debug.h: Add a new macro DITRACE for tracing device instances.
1337 * debug.h: Extend the DTRACE macro so that it can also tests for
1338 device specific tracint.
1340 * device.h, device.c (device_trace): Add method to determine
1341 device specific tracing.
1342 (device_init_address): Set the devices tracing level.
1346 * tree.h, tree.c (tree_device): New files - separate out the
1347 device parser and other tree operations from the device.
1349 * inline.h, inline.c (INLINE_TREE): Add.
1350 * device.h, device.c (device_tree_add_parsed): Delete.
1351 * Makefile.in (tree.c): Add rules for new file.
1352 * Makefile.in: Better order the emul_* files.
1354 * emul_generic.c (emul_add_tree_hardware): Update.
1355 * emul_netbsd.c (emul_netbsd_create): Update.
1356 * emul_unix.c (emul_unix_create): Ditto.
1357 * emul_chirp.c (emul_chirp_create): Ditto.
1358 * emul_bugapi.c (emul_bugapi_create): Ditto.
1359 * psim.c (psim_tree): Ditto.
1362 * emul_generic.h: Include tree.h
1363 * Makefile.in: Add to EMUL_GENERIC_H dependencies.
1365 * device.h, device.c (device_root): New function - returns the
1369 * device.h, device.c (device_clean): New function, clean up device
1370 ready for next simulation run. This includes things like deleting
1371 interrupt edges and properties created during the simulation and
1372 also scrubbing any pre-defined properties.
1373 * tree.c (tree_init): Use.
1375 * device.h, device.c (device_init_static_properties): New
1376 function. Initialize any static predefined properties. By static
1377 we mean those that have values that can be determined before the
1378 device tree initialization has started.
1379 * tree.c (tree_init): Use.
1381 * device.h, device.c (device_init_address): Add code to
1382 check/verify the devices #address-cells and #size-cells.
1383 (device_add_integer_property): Delete corresponding code.
1384 (device_nr_address_cells, device_nr_data_cells): Check for
1385 property when returning value.
1387 * device.h, device.c (device_init_runtime_properties): New
1388 function. Initialize those properties that are not `static'. At
1389 present the only such property is the ihandle.
1390 * tree.c (tree_init): Use.
1392 * device.h, device.c (reg, ranges): Rework these so that they use
1393 an array of the fundamental type - single reg or single range
1396 * device.h, device.c (device_add_ihandle_runtime_property):
1397 Re-implement the adding of an ihandle during tree construction so
1398 that it better fits in with device initialization.
1402 * device.h, device.c (device_ioctl): Add additional argument -
1403 request - so that the caller must always specify the type of
1406 * device_table.h: Update.
1407 * hw_trace.c (hw_trace_ioctl): Ditto.
1408 * hw_vm.c (hw_vm_ioctl_callback): Ditto.
1409 * hw_init.c (hw_stack_ioctl_callback): Ditto.
1410 * psim.c (psim_options): Ditto.
1414 * BUGS: Updated a bit.
1418 * hw_opic.c: Finish - third round.
1422 * hw_glue.c (hw_glue_io_read_buffer_callback): Fix miscalc of glue
1424 (hw_glue_io_write_buffer_callback): Ditto.
1428 * events.c (event_queue_process): Was incorrectly consuming future
1429 events on the queue when they should be left alone.
1431 * debug.h, debug.c (events): Add support for event queue tracing.
1432 * events.c: Add event tracing.
1434 * debug.h, debug.c: Order device trace options.
1438 * pk_disklabel.c (pk_disklabel_create_instance): Fix up some
1439 warnings generated by GCC.
1443 * sim-endian.h: Add LE versions of byte swap macros. Needed for
1444 PCI devices which are little-endian.
1446 * sim-endian-n.h (endian_le2h_N, endian_h2le_N): Ditto
1450 * hw_iobus.c (hw_iobus_attach_address_callback): Change the iobus
1451 so that it is implementing a 1-1 address map.
1453 * emul_generic.c (emul_add_tree_hardware): Adjust.
1455 * emul_generic.c (emul_add_tree_hardware): Don't add the nvram as
1460 * device.c (split_find_device): Be tolerant of missing unit
1465 * basics.h (port_direction): New type, specify the direction of
1468 * device.h, device.c (device_interrupt_decode): Include
1469 specification of port direction in operations.
1470 (device_interrupt_encode): Ditto.
1472 * device_table.h: Add a direction field to the interrupt port
1475 * device.c (device_tree_add_parsed): Specify port direction.
1479 * hw_opic.c: Finish - second round.
1483 * hw_htab.c (htab_init_data_callback): Allow the virtual-address
1484 to be specified as an array which allows 64bit addresses.
1486 * device.c (device_find_integer_array_property): New function.
1487 Simplify the querying of elements of an integer array.
1488 (device_add_integer_property, device_find_integer_property):
1489 Update to correctly use the cell type.
1491 * vm.c (om_unpack_sr): Clarify shifting comment.
1492 (om_pte_0_masked_vsid): Ditto. Add 64bit version.
1494 * emul_chirp.c (emul_chirp_create): Initialize the segment
1497 * vm.c (om_effective_to_virtual): Trace segment register use.
1499 * hw_htab.c (htab_map_page): Print out the pteg base address to
1500 simplify cross checking between vm and the htab.
1501 (htab_decode_hash_table): Use device_error instead of error.
1502 (htab_map_page): Ditto.
1503 (htab_dma_binary): Ditto.
1504 (htab_map_binary): Ditto.
1505 (htab_init_data_callback): Ditto.
1509 * interrupts.h: Clarify what the optional instruction program
1510 interrupt is - a subset of illegal instruction program interrupt.
1512 * interrupts.c (program_interrupt): For UEA mode, clarify what an
1513 optional instruction program interrupt is.
1514 (program_interrupt): For OEA mode, as per spec, generate an
1515 illegal instruction program interrupt when an optional instruction
1518 * gen-semantics.c (print_semantic_body): Delete code
1519 differentiating between an unimplemented floating point and normal
1520 instruction. Instead, such a case can be handled explicitly.
1522 * ppc-instructions (store floating-point as integer word indexed):
1524 (Floating Convert to Integer Doubleword): Make the floating point
1525 assist interrupt explicit.
1526 (Floating Convert To Integer Doubleword with round towards Zero):
1528 (Floating Convert To Integer Word): Ditto
1529 (Move From FPSCR): Ditto.
1530 (Move to Condition Register from FPSCR): Ditto.
1531 (Move To FPSCR Fields): Ditto.
1532 (Move To FPSCR Field Immediate): Ditto.
1533 (Move To FPSCR Bit 0): Ditto.
1534 (Move To FPSCR Bit 1): Ditto.
1538 * corefile.c (core_map_read_buffer, core_map_write_buffer): Avoid
1539 breaking up transfers.
1541 * corefile.c: Adjust arguments so that the client server
1542 relationship is clarified.
1544 * hw_glue.c (hw_glue_init_address): Update so it can be attached
1547 * hw_disk.c (hw_disk_instance_write): Add more checks to disk IO -
1548 looking for things like overflow/underflow.
1552 * emul_generic.c (emul_add_tree_hardware): Hang the disk off the
1553 PAL device instead of the IOBUS. The disk must be attached to a
1556 * hw_disk.c (hw_disk_init_address): Just use the unit address
1557 directly in the attach - the rest isn't relevant.
1561 * configure.in (sim-hardware, sim-packages): Allow additional
1562 hardware and packages to be prefixed as well as appended.
1564 * Makefile.in (tmp-hw, tmp-pk): Retain the user specified order of
1565 packages when building them. Consequently, a user can override a
1566 standard device by prefixing their own version.
1568 * Makefile.in (hw_opic.o, hw_pci.o, hw_ide.o): Add dependencies.
1572 * mon.c (_cpu_mon): Add fields for counting 1, 2, 4, and 8 byte
1574 (mon_{read,write}): Count 1, 2, 4, and 8 byte reads/writes.
1575 (mon_print_info): Correct typo regarding # of unaligned reads and
1576 writes. Print out how many 1, 2, 4, and 8 byte reads/writes there
1581 * configure.in (AC_CHECK_FUNCS): Add access.
1582 * config{.in,ure}: Regenerate.
1584 * emul_unix.c (do_unix_nop): System call that always succeeds.
1585 (do_unix_access): Support access system call.
1586 (solaris_descriptors): Make sigaltstack and sigaction nops.
1587 ({solaris,linux}_descriptors): Add support for access.
1591 * Makefile.in (clean): Move config.log to distclean.
1595 * corefile-n.h (core_map_write_N): Improve abort messages.
1597 * device.h, device.c (device_attach_address): Remove unused name
1599 (device_detach_address): Ditto.
1600 * device_table.h, device_table.c: Update.
1601 * hw_iobus.c (hw_iobus_attach_address_callback): Ditto.
1602 * hw_nvram.c (hw_nvram_init_address): Ditto.
1603 * hw_memory.c (hw_memory_init_address): Ditto.
1604 * hw_vm.c (hw_vm_init_address_callback): Ditto.
1605 (hw_vm_attach_address): Ditto.
1606 (hw_vm_add_space): Ditto.
1607 * hw_init.c (update_for_binary_section): Ditto.
1608 * hw_core.c (hw_core_attach_address_callback): Ditto.
1610 * hw_iobus.c (hw_iobus_attach_address_callback): Rewrite to handle
1611 configurable parent busses.
1615 * device_table.c (generic_device_size_to_attach_size): Provide
1616 limited support for multi-cell sizes.
1617 (generic_device_address_to_attach_address): Ditto for addresses.
1621 * device.c (device_add_integer_property): Check for setting of
1622 #address-cells and #size-cells properties. For these, update the
1623 corresponding device values.
1624 (device_nr_address_cells, device_nr_size_cells): Use the value
1625 from the device instead of the property.
1627 * hw_core.c: Use generic address and size conversions for the top
1630 * hw_memory.c (hw_memory_init_address): Tolerate case where
1631 #address and #size cells is greater than 1.
1633 * device.c (device_tree_print_device): Clean out printing of
1636 * device.c (split_device_specifier): Don't detect comments here -
1637 "#" can be a valid prefix - eg #size-cells.
1639 * psim.c (psim_merge_device_file): Suppress comments and blank
1642 * emul_generic.c (emul_add_tree_hardware): Fix typo of incorrect
1643 pal unit address. Add the property /#address-cells to the root of
1646 * device.c (device_template_create_device): Check that the unit
1647 address was successfully parsed.
1649 * device_table.c (generic_device_unit_decode): Rewrite to better
1650 handle multi-cell addresses.
1651 (generic_device_unit_encode): Ditto.
1653 * emul_generic.c (emul_add_tree_hardware): "reg" properties no
1654 longer need the explicit array type - the parser takes care of it.
1656 * pk_disklabel.c (pk_disklabel_create_instance): Add NULL return
1661 * hw_ide.c: New file. Model of a basic IDE interface attached to
1664 * configure.in (hardware): Add the ide device to the default
1666 * configure: Regenerate.
1668 * debug.h, debug.c: Add tracing option for the IDE device.
1672 * hw_phb.c, hw_phb.h: New files - implement a PHB.
1674 * configure.in (hardware): Add the phb to the list of devices to
1679 * hw_com.c: Review description.
1682 * hw_eeprom.c: Ditto.
1686 * hw_com.c: Update event handling.
1688 * hw_disk.c: Implement tracing.
1692 * device_table.c (generic_device_init_address): Use
1693 assigned-addresses property in preference to any other reg
1698 * device.h, device.c (device_find_ranges_property): New function.
1699 Simplify the manipulation of "ranges" properties.
1701 * device.c (device_add_parsed): Extend to include support for the
1704 * device.c (device_add_parsed): Add assigned-addresses to the list
1705 of reg type properties.
1707 * device.c (device_tree_print_device): Add code to format and
1708 print a ranges property.
1710 * device.h, device.c (device_nr_address_cells,
1711 device_nr_size_cells): New functions. Determine the values of the
1712 standard properties #address-cells and #size-cells. Both of which
1713 are optional and have default values of two and one respectfuly.
1714 Previously, code that determined #address-cells was incorrectly
1715 using a value of one.
1719 * debug.h, debug.c: Sort debug options, Add entries for the
1724 * ppc-instructions (Floating Select): Add support for fsel unless
1725 model is 601. Allow user to filter out instruction unless -Fs is
1727 (Store Floating-Point as Integer Word Indexed): Raise optional
1728 instruction program abort. Allow user to filter out instruction
1729 unless -Fs is passed to igen.
1730 (Floating Square Root{, Single}): Ditto.
1731 (Floating Reciprocal Estimate Single): Ditto.
1732 (Floating Reciprocal Square Root Estimate): Ditto.
1734 * configure.in (--enable-sim-filter): If not passed, pass 32,f,s
1736 * configure: Regenerate.
1738 * interrupts.h (program_interrupt_reasons): Add
1739 optional_instruction_program_interrupt.
1741 * interrupts.c (program_interrupt): Call error with more detailed
1742 information on program interrupts, particularly in user mode. Add
1743 support for optional_instruction_program_interrupt.
1747 * hw_glue.c: New device. Hooks for manipulating interrupt ports.
1749 * debug.h, debug.c (trace_glue_device): Add tracing support for
1750 the interrupt glue logic device.
1752 * configure.in (hardware): Add glue device.
1753 * configure: Regenerate.
1757 * device.c (device_tree_parse_integer_property): New function,
1758 parse a list of integers as an array property.
1759 (device_tree_add_parsed): Call it.
1761 * device.c (device_tree_parse_string_property): New function,
1762 parse a list of strings as a string property (with embeded
1763 null's). For moment, don't try to implement a complext string
1765 (device_tree_add_parsed): Call it.
1769 * hw_opic.c: New file. OpenPIC interrupt controller.
1771 * configure.in (hardware): Add opic device.
1772 * configure: re-generate.
1774 * hw_pic.c: Delete, replaced with hw_opic.c.
1776 * debug.h, debug.c: Add debug option for OpenPIC device. -
1781 * Makefile.in (psim.o, idecode.o): Since idecode and not psim is
1782 now the file that does all the inlining.
1784 * Makefile.in (LIB_SRC, LIB_INLINE_SRC, idecode.o): Break out the
1785 library source code that could be involved in an inlining. Make
1786 idecode.o only dependant on the inlined library source code.
1788 * Makefile.in (LIB_OBJ): Put options last on the list so that it
1791 * std-config.h (DEVICE_INLINE): Only inline locals when the
1792 default is to inline.
1796 * hw_htab.c (htab_sum_binary): Determine the real-base for the
1799 * hw_htab.c (htab_map_binary): Depending on the value of the
1800 load-base, either map the program in as a contiguous section or as
1801 separate sections controled by th binaries lma values.
1802 (htab_init_data_callback): Ditto.
1806 * emul_generic.c (emul_add_tree_options): Remove load-base option.
1808 * emul_chirp.c (map_over_chirp_note): Add load_base field to note
1809 struct. Don't require the load_base field to be present - just
1810 issue warning - it is a recent addition.
1811 (emul_chirp_create): Support both virtual and physical modes.
1813 * emul_chirp.c (emul_chirp_create): Add a stack initialization
1814 property so that any arguments specified on the command line can
1815 be passed on to user programs.
1817 * hw_init.c (create_ppc_chirp_bootargs): Add support for chirp
1818 argument passing to the pseudo device stack.
1822 * device.c (device_error): Make it more tolerant to incomplete
1825 * hw_init.c (hw_data_init_data_callback): Extend the data device
1826 so that it can perform initialization operations either dma or a
1827 more complex instance open, seek, write operation.
1828 * hw_init.c: Update the description of the data device to reflect
1833 * device.c (device_event_queue_schedule,
1834 device_event_queue_deschedule, device_event_queue_time): Have the
1835 device object export the event operations. Making these available
1836 from the device object should hopefully simplify writing device
1841 * configure.in (sim-hardware): Add eeprom device to default build.
1843 * hw_eeprom.c: Rewrite so it works.
1845 * debug.h, debug.c: Add tracing support for the eeprom and com
1850 * debug.h: Add disklabel-package and disk-device trace options.
1851 debug.h (PTRACE): Add macro to simplify tracing in packages.
1855 * device.c (device_create_instance_from): Tighten up loop
1856 searching for device instances.
1857 (device_instance_delete): Ditto.
1858 (device_instance_delete): Only leaf instances need to be removed
1859 from a devices list of active instances.
1863 * hw_disk.c: Add the cdrom as an alias.
1865 * pk_disklabel.c (disklabel_delete): Implement, remembering to
1866 delete the raw disk instance while we're at it.
1868 * pk_disklabel.c (pk_disklabel_create_instance): Implement a
1869 little bit more - still a long way to go.
1871 * pk_disklabel.c (disklabel_write, disklabel_read): Remember the
1872 new head position after a read or write.
1876 * emul_chirp.c (chirp_emul_read): Allow reads to be longer then
1877 the internal buffer.
1881 * emul_chirp.c (chirp_read_t2h_args): Call memset-0 with the args
1882 in the correct order.
1884 * emul_chirp.c (chirp_emul_call_method): Correct computation for
1885 the address of the first stack argument passed in from the client
1890 * words.h: Add new types signed_cell and unsigned_cell which
1891 correspond to the signed and unsigned IEEE 1275 memory locations.
1892 * device.h, device.c, emul_chirp.c: Where refering to an IEEE 1275
1893 memory cell, replace uses of unsigned32 with unsigned_cell.
1894 * device_table.h: Ditto.
1896 * sim-endian.h: Add new macros H2BE_cell and BE2H_cell which
1897 convert cell sized values to from big endian.
1898 * device.c, emul_chirp.c: Where refering to IEEE 1275 memory cells
1899 use these new macros.
1903 * device.c (device_tree_add_parsed): Detect and report an
1904 interrupt being attached to an invalid device. Was dumping core.
1908 * device.h, device.c (device_address_to_attach_address,
1909 device_size_to_attach_size): New functions. Convert a devices
1910 unit address or unit size structure into a form suitable for
1911 passing on to the attach and detach functions.
1912 * device_table.h: Add extra methods to device table.
1914 * device.h, device.c (device_find_reg_property): New function.
1915 For a reg type property, return the selected address + size
1916 tupple, along with a positive success status. Add a reg_property
1917 to the list of property types.
1918 * (device_tree_add_parsed): Make array properties with the name
1919 reg or alternate-reg of type reg_property.
1921 * hw_memory.c (hw_memory_init_address): Rewrite to use new
1922 find_reg_property method.
1923 * hw_nvram.c (hw_nvram_init_address): Ditto.
1925 * device.c (device_tree_print_device): Add code to print out a reg
1928 * device_table.c (generic_device_address_to_attach_address,
1929 generic_device_size_to_attach_size ): New functions. Generic
1930 functions for converting between unit and attach address or size.
1932 * device_table.c (generic_device_init_address): Rewrite to use the
1933 new find_reg and address convert functions. Look for both reg and
1934 alternate-reg properties.
1938 * hw_com.c: New file. A '550 serial device that can quickly be
1939 attached to any bus.
1940 * configure.in (enable-sim-hardware): Add the com device.
1941 * configure: re-generate.
1945 * device.c (device_tree_verify_reg_unit_address): New
1946 function. Check that the unit address as specified by the reg
1947 property correctly corresponds to any unit address previously
1948 specified by the devices name.
1949 (device_tree_add_parsed): When adding a reg property, verify
1950 that the unit-address - first value of property - correctly
1951 matches any previous value specified when creating the device
1956 * mon.c (mon_event): Remove assertion that an unsigned is >= 0.
1960 * device.c (device_full_name): Cast strdup to char *, since AIX
1961 3.2.5 mistakenly declares the function to be const char *.
1962 (device_create_from): Ditto.
1963 (device_create_instance_from): Ditto.
1964 (device_add_property): Ditto.
1968 * debug.c (trace_option): For -t all, do not set the
1969 trace_dump_device_tree flag, so that the simulator is run.
1973 * Makefile.in (options.o): Depend on defines.h.
1974 (defines.h): New rule, go through config.h and make strings of all
1975 of the #define HAVE_xxx macros.
1976 (distclean): Remove defines.h.
1978 * options.c (print_options): Print whether many of the
1979 configuration macros are defined.
1981 * main.c (main): If -t options and no filename, just print the
1982 options, and don't print the usage message.
1986 * configure.in: Test whether /dev/zero works on the system, and if
1987 it does, define HAVE_DEVZERO.
1988 * configure: Regenerate.
1990 * emul_generic.c (emul_add_tree_hardware): Do not add /iobus/disk
1991 if we don't have a working /dev/zero on the system.
1993 * emul_bugapi.c (emul_bugapi_init): If HAVE_DEVZERO is not
1994 defined, don't add disk support.
1995 (emul_bugapi_do_diskio): Ditto.
1996 (emul_bugapi_instruction_call): Ditto.
2000 * emul_unix.c (HAVE_TCGETATTR): If HAVE_TERMIOS_STRUCTURE is not
2001 defined, make sure HAVE_TCGETATTR is #undef'ed
2005 * std-config.h (REGPARM): Only define REGPARM attributes if using
2006 GNU C. Test for __i686__ in case GCC ever defines it. If not on
2007 a x86 platform, define REGPARM as nothing.
2009 * sim-endian.h (WITH_HOST_BYTE_ORDER): Test for i686 and __i686__
2014 * ld-decode.h, ld-decode.c: Rename goto_gen to the more correct
2016 * gen-idecode.c: Ditto.
2018 * gen-idecode.c (print_idecode_table): Comment out check for
2019 switch/table combination until a bug with it is fixed.
2021 * ppc-opcode-goto: New file. Like complex and flat but uses
2022 goto-switch instead of padded-switch for the tables.
2024 * gen-idecode.c (print_goto_switch_name): New function.
2025 (print_goto_switch_table_leaf): New function.
2026 (print_goto_switch_break): New function.
2027 (print_goto_switch_table): New function. Prints a jump table
2028 that can be jumped into instead of a switch statement.
2030 * gen-idecode.c (*switch_*): As an option output a switch that is
2031 implemented using a jump table but only if the switch is not
2036 * configure.in (--enable-sim-{hardware,packages}): Fix typos.
2037 * configure: Regenerate.
2039 * device.c (device_instance_call_method): Fixup format message in
2040 error case. Return 0 in case of error to shut up compiler
2045 * device_table.c (generic_device_unit_decode): Require a comma
2046 between elements of a unit address.
2048 * device.c (device_tree_print_device): For reg, alternate-reg and
2049 ranges properties use special print functions.
2050 (device_print_ranges_property): Print formatted ranges property.
2051 (device_print_reg_property): Print formatted reg property.
2055 * device.c (device_tree_add_parsed): For reg, ranges and
2056 alternate-reg properties use a special parser.
2057 (device_tree_parse_reg_property): New function to parse a reg
2059 (device_tree_parse_ranges_property): New function to parse a
2061 (device_encode_unit): Wrapper for encode_unit callback.
2062 (device_decoce_unit): Wrapper for decode_unit callback.
2066 * device_table.h (device_instance_callbacks): Relace the claim and
2067 release methods with a more general table mapping from method-name
2070 * device.c (device_instance_call_method): New function. Implement
2071 the OpenBoot call-method client interface. Attempts to locate the
2072 instances method in the callback table.
2073 (device_instance_claim, device_instance_release): Delete.
2074 Replaced with call-method and a lookup table.
2076 * emul_chirp.c (chirp_emul_call_method): Use the new device
2077 instance call method and let that handle a client claim call.
2079 * hw_htab.c (claim_memory): Wrapper function to call the memory
2080 devices "claim" method using the new device-instance call-method
2081 interface. Replaces the previous direct calls to claim.
2082 (htab_map_region): Use claim_memory.
2083 (htab_init_data_callback): Ditto.
2085 * hw_memory.c (hw_memory_instance_claim): Update function
2086 interface so that it is compatible with call-method.
2087 (hw_memory_instance_release): Ditto.
2088 (hw_memory_instance_methods): New table of memory specific
2089 methods claim and release. Add to the hw_memory_callback
2094 * psim.c (psim_init): Back out of change to initial value of
2099 * sim_callbacks.h (sim_io_printf_filtered): Replace
2100 printf_filtered with a local simulator specific version. Add
2101 #define printf_filtered to simplify updating of existing code.
2103 * sim_callbacks.h (sim_io_write_stdout, sim_io_read_stdin,
2104 sim_io_write_stderr): New functions. Read / write to the
2105 simulations stdin and stdout and stderr interfaces. Merge in code
2106 from hw_pal that previously handled async I/O.
2107 (sim_io_flush_stdoutput): Rename flush_stdoutput. Add #define
2108 flush_stdoutput to simplify updating of existing code.
2110 * hw_pal.c (scan_hw_pal, write_hw_pal,
2111 hw_pal_instance_write_callback): Use the new sim_io functions.
2113 * main.c: Implement standalone versions of the new sim_io
2114 functions. Include support for async I/O.
2115 * sim_calls.c: Ditto. This time using the gdb callback table.
2117 * std-config.h (CURRENT_STDIO, current_stdio): New macro. Set up
2118 stdio configuration so that it works in the same way as the rest
2120 * psim.c (psim_create): Initialize current_stdio from the device
2122 * emul_generic.c (emul_add_tree_options): Enter a default value
2123 for use-stdio in the device tree.
2127 * gen-idecode.c (print_jump): Was always generating a jump back to
2128 idecode. Only necessary at tail of semantic code.
2129 (print_jump): Was always setting the processor's cia, even during
2130 startup when the processor was still undefined.
2131 (print_jump): For safety, restart smp loop when cpu_nr >= nr_cpus,
2134 * options.c (print_options): Add printing of WITH_REGPARM and
2137 * std-config.h (WITH_REGPARM, WITH_STDCALL): Provide default
2138 (disabled) values if not defined.
2142 * ppc-cache-rules (cache): Change RS and RB to cache instead of
2143 compute. The block move instructions use them.
2145 * idecode_expression.h (FPSCR_SET): New macro, set specific FPSCR
2147 (CR_FIELD): New macro, extract specific CR register.
2148 (FPSCR_FIELD): New macro, extract specific FPSCR register.
2150 * registers.h (GPR): New macro, simplify accesses to GPR[i].
2152 * bits.c (INSERTED): Covert INSERTED macro into a function.
2153 (EXTRACTED): Conditionally compile on correct bit size macro.
2155 * bits.h (BIT8): New macro, set a single bit in an 8 bit byte.
2157 * ppc-instructions: With hints from Paul Martin, type in missing
2158 some instruction semantics. Leave disabled for the moment.
2159 (Load Multiple Word): Ditto.
2160 (Store Multiple Word): Ditto.
2161 (Load String Word Immediate): Ditto.
2162 (Load String Word Indexed): Ditto.
2163 (Store String Word Immedate): Ditto.
2164 (Store String Word Indexed): Ditto.
2165 (Move to Condition Register from XER): Ditto.
2166 (Move From Condition Register): Ditto.
2167 (Move From FPSCR): Ditto.
2168 (Move to Condition Register from FPSCR): Ditto.
2169 (Move To FPSCR Field Immediate): Ditto.
2170 (Move To FPSCR Fields): Ditto.
2171 (Move To FPSCR Bit 0): Ditto.
2172 (Move To FPSCR Bit 1): Ditto.
2176 * std-config.h (SEMANTICS_INLINE): By default, mask out the
2177 inlining of semantic functions from DEFAULT_INLINE. Almost all
2178 configurations call the semantic code via a pointer so there is
2181 * std-config.h (ICACHE_INLINE): Ditto.
2185 * configure.in (sim_regparm): Add configuration option for
2186 enabling GCC's regparm attribute.
2187 * (sim_stdcall): Add configuration option for enabling GCC's
2190 * Makefile.in (REGPARM_CFLAGS): Pass regparam configuration onto
2192 * (STDCALL_CFLAGS): Pass stdcall configuration onto compilations.
2194 * std-config.h (REGPARM): Extend construction of REGPARM macro so
2195 that it can include __stdcall__ function attribute.
2197 Wed Jul 24 19:04:20 1996 Andrew Cagney <cagney@sawnoff>
2199 * options.c (print_options): Include SUPPORT_INLINE in information
2202 * gen-idecode.c (print_run_until_stop_body): Only generate loop
2203 termination test if creating idecode_run_until_stop. Push the
2204 loop termination test back into each alternative branch.
2208 * gen-icache.c (print_icache_function): Have the cache function
2209 always update the cache_entries semantic and address fields.
2211 * gen-idecode.c (print_idecode_switch_illegal): Include a break
2212 when generating illegal instructions. This was commented out
2213 which is a hangover from looking a at switch statements generated
2214 using indirect jumps.
2218 * igen.c (print_my_defines): Replaces print_define_my_index.
2219 Print both a definition for MY_INDEX and MY_PREFIX.
2220 * gen-icache.c (print_icache_function): Adjust.
2221 * gen-idecode.c (print_jump_insn): Adjust.
2222 * gen-semantics.c (print_c_semantic): Adjust.
2224 * gen-support.c (gen_support_h): Add optional include to created
2225 support.h so that, like cpu, it is optionally inlined for all
2226 modules that include it.
2227 * inline.h, inline.c: Adjust so that support.[hc] is handled the
2230 * idecode_fields.h (LABEL, GOTO): Macro's that create a unique
2231 name for a lable and then branch to it.
2233 * ppc-instructions (convert_to_integer, Floating Round to
2234 Single-Precision, Floating Convert from Integer Doubleword): Use
2235 LABEL and GOTO instead of the recently added switch statements.
2239 * gen-idecode.c (print_run_until_stop_body): Too many rparen in
2244 * configure.in (--enable-sim-line-nr): Typo - sim_line-nr.
2245 * (--enable-sim-inline): Reorder patern matching of arguments so
2246 that SUPPORT=ALL_INLINE is reconized as *=* and not *_INLINE.
2248 * configure: rebuild.
2252 * configure.in (--enable-sim-hardware, --enable-sim-packages): New
2253 configuration options. Let the user specify the packages or
2254 hardware devices that are to be included in the build. Makes it
2255 possible for user packages to be specified.
2257 * Makefile.in (tmp-pk, tmp-hw): Just use the list of packages and
2258 hardware instead of checking it using ls. configure.in should
2259 have taken care of any problems.
2260 (HW_SRC, HW_OBJ, PACKAGE_SRC, PACKAGE_OBJ): Set by configure.
2264 * psim.c (psim_options): Enter the argument to the memory size
2265 option directly into the device tree. Was using atol() which is
2266 dangerously non portable.
2270 * configure.in (icache): Extend icache flag to include an insn
2271 option. If specifyed the insn - aka instruction - is included in
2272 the instruction cache. Make this the default.
2273 * configure: re-generate.
2275 * igen.c (main), igen.h: Add option -S - inSn - for specifying
2276 that the instruction should be included in the icache.
2278 * gen-icache.c (print_icache_body): If enabled, output code to put
2279 the instruction into the icache.
2280 (print_icache_struct): If enabled, add insn to the icache struct.
2284 * Makefile.in (BUILD_CFLAGS): Include -g when building the
2289 * emul_generic.c (emul_add_tree_options): Was incorrectly setting
2290 the strict-alignment option when hardwired for non-strict
2295 * gen-semantics.c: Make the my_index variable a macro MY_INDEX.
2297 * ppc-instructions: Adjust so that references are to MY_INDEX and
2302 * gen-idecode.c: Output the complete run_until_stop function
2303 instead of just the code to handle a single instruction issue.
2304 * : Have the generated idecode.c include inline.c (instead of psim.c).
2306 * std-config.h: Change psim.c so that it isn't inlined (as this is
2309 * psim.c (run_until_stop): Delete the old run_until_stop function
2310 instead calling the idecode_run and idecode_run_until_stop
2311 functions that gen-idecode.c is now creating.
2315 * dgen.c: Maintenance - update to use new features found in lf.c.
2317 * filter_filename.c (filter_filename): Maintenance - make the
2322 * debug.c (TRACE, ITRACE, DTRACE): Have GCC instead of CPP
2323 eliminate trace statements.
2325 * debug.c: Change trace format so that it is consistent
2326 (file:line-nr) with CC's error output.
2328 * gen-itable.c (itable_c_insn): Add the source file name and
2329 source line number to the instruction's informational entry.
2331 * debug.c (ITRACE): Use the itable (and my_index) to get the
2332 current instructions name and source line number.
2334 * gen-semantics.c, gen-icache.c: Adjust generated ITRACE calls to
2335 match new interface.
2337 * emul_bugapi.c (emul_bugapi_instruction_call): Adjust
2338 corresponding call to ITRACE so that it still matches.
2340 * idecode_expression.h (ALU_END, CR0_COMPARE): Use TRACE instead
2341 of ITRACE. The CPP line directives would have previously set the
2342 line-nr and file name so ITRACE isn't needed.
2346 * gen-idecode.c (print_jump_until_stop_body): New function and
2347 idecode generation option. Instead of generating and calling
2348 separate functions containing the semantic and icache code
2349 generate a single monolythic function and use goto's (and GCC's
2350 indirect jump) to move between code blocks.
2352 * Makefile.in: Add sim_jump flag to those passed to igen.
2354 * configure.in: New option --enable-sim-jump (default disabled)
2356 * ppc-instructions: Eliminate any uses of labels and goto's.
2357 These result in duplicate declarations when a single flat function
2360 * ppc-opcode-jump: New file. Set of opcode rules useful when
2361 testing jumping idecodes.
2365 * gen-idecode.c: Optionally include the semantic code for an
2366 instruction in the function that is doing the decoding.
2368 * igen.c: Add option (-C) to generate semantics in the instruction
2371 * configure.in (--enable-sim-icache): Accept an option list such
2372 as 1024,define. Add a new choice to the list - semantic - which
2373 will cause igen to generate instruction decode functions that
2374 include the corresponding semantic code.
2378 * configure.in: New option --enable-sim-line-nr (default enabled).
2379 Enable/disable the inclusion of CPP line directives in the
2380 generated files. Such directives refer back to the source files
2381 used when generating the simulator code.
2383 * Makefile.in (sim_line_nr): Pass to igen.
2387 * igen.c (main): Revamp the options so that more letters are
2390 * configure.in: Adjust to match igen's revamped options
2394 * Makefile.in (pk.h, hw.h): Rewrite depenencies for hw.h (etc) so
2395 that they use the same technique as igen (ie a dummy targets
2396 tmp-pk and tmp-hw are created).
2400 * Makefile.in (BUILD_CFLAGS): Include WARNING_CFLAGS.
2404 * ld-cache.[hc], ld-decode.[hc], ld-insn.[hc]: New files. Separate
2405 out the loading of each of the tables from the rest of igen.
2406 * Makefile.in: Adjust.
2409 * gen-icache.[hc], gen-idecode.[hc], gen-itable.[hc],
2410 gen-model.[hc], gen-semantics.[hc]: New files. Separate out the
2411 code creating each separate set of generated files.
2412 * Makefile.in: Adjust.
2415 * gen-support.[ch]: New files. Output the support functions (found
2416 in the ppc-instructions file) into a separate file.
2418 * inline.h, inline.c: Add.
2419 * std-config.h: Add.
2421 * ld-cache.c: Re-design the cache table format.
2422 * ppc-cache-rules: Update to new format.
2424 * ld-decode.c: Re-design the decode table format.
2425 * ppc-opcode-simple: Update to new format
2426 * ppc-opcode-complex: Ditto
2427 * ppc-opcode-flat: Ditto
2429 * filter.h, filter.c: New files. Separate the opcode filter table
2430 reading code from the rest of igen.c. Re-design the filter so that
2431 it works inclusivly not exclusivly.
2432 * igen.c: Remove the opcode filter table loading code.
2433 * Makefile.in (filter.o): Adjust
2434 * configure.in: Adjust filter flag so that default includes 32bit
2436 * ppc-instructions: Clean up filter fields so that only in use
2437 entries are specifed (ie delete `be').
2439 * misc.c (name2i, i2name): New function. Map between a string and
2444 * sim_calls.c (sim_close): If simulator not created, skip printing
2449 * registers.c (register_description): Typo, insns not insn.
2451 * ppc-instructions (model_get_number_of_stalls): New model function,
2452 returns number of stalls for the specified processor.
2453 * psim.c (psim_read_register): Add call to new function
2454 model_get_number_of_stalls().
2456 * ppc-instructions (model_get_number_of_cycles): New model function,
2457 returns number of stalls for the specified processor.
2458 * psim.c (psim_read_register): Add call to new function
2459 model_get_number_of_cycles().
2463 * device_table.h: Don't pass the parent device into a devices
2464 create function. This makes the create function consistent with
2466 * device.c (device_template_create_device): Ditto
2467 * hw_pal.c (hw_pal_create): Ditto
2468 * hw_core.c (hw_core_create): Ditto
2469 * hw_vm.c (hw_vm_create): Ditto
2470 * hw_disk.c (hw_disk_create): Ditto
2471 * hw_nvram.c (hw_nvram_create): Ditto
2472 * hw_memory.c (hw_memory_create): Ditto
2473 * hw_cpu.c (hw_cpu_create): Ditto.
2475 * device.c (split_find_device): Allow a null initial parent device.
2476 (device_template_create_device): Ditto.
2478 * device.c (device_create_from): Make local (static) only used
2480 * device_table.h: typedef device_callbacks moved here (from
2481 device.h) where it belongs.
2483 * hw_core.c: New file. Implements just the core device using the
2486 * corefile.c: Moved all core device functions into the new
2487 hw_core.c file. core_device_create() disapears.
2489 * psim.c (psim_tree): Use device_tree_add_parsed() to create the
2494 * hw_init.c: Correct typo in comment.
2496 * corefile.c (core_init): Remove any remaining references to a
2498 (core_map_find_mapping): Ditto.
2502 * corefile.c (core_init): Make function global so that other
2503 devices are able to use the full core object.
2505 * corefile.c (core_create, core_from_device): Break core_create
2506 into two functions. The first creates a core object, the second
2507 returns the core object associated with a core device.
2509 * corefile.c (core_device_create): Use core_create to make the
2512 * psim.c (psim_create): Use core_from_device() instead of
2515 * device.c (device_template_create_device): Make static as only
2516 needed by functions internal to device.c.
2520 * ppc-opcode-test-2: Remove description of fields.
2521 * ppc-opcode-complex: Ditto
2522 * ppc-opcode-flat: Ditto
2523 * ppc-opcode-simple: Ditto
2524 * ppc-opcode-stupid: Ditto
2525 * ppc-opcode-test-1: Ditto
2526 * ppc-cache-rules: Ditto
2528 * igen.c: Add description of files as a comment at the front.
2532 * configure.in: Check for whether the termios and termio
2533 structures are really defined, and whether or not, they define the
2535 * configure: Regenerate.
2537 * Makefile.in ({,TERMIO_}CFLAGS): Add TERMIO_CFLAGS options set by
2540 * emul_unix.c: Various changes to allow for building on systems
2541 with different termio and termios structures. If host has both
2542 termio and termios, just use termios. No longer include
2547 * Makefile.in (bindir, libdir, datadir, mandir, infodir, includedir,
2548 INSTALL_PROGRAM, INSTALL_DATA): Use autoconf-set values.
2550 * configure.in (AC_PREREQ): autoconf 2.5 or higher.
2551 (AC_PROG_INSTALL): Added.
2552 * configure: Rebuilt.
2556 * corefile.h: Rewrite documentation so that it can be extracted and
2557 converted into texinfo (and hence ready for translation into html,
2563 * hw_disk.c (SEEK_SET): If SEEK_SET is not defined, define as 0.
2565 Wed Jun 5 11:46:52 1996 Andrew Cagney <cagney@puddin>
2567 * hw_disk.c: Include <unistd.h> if available. Under SunOS, that
2568 is the source of SEEK_SET.
2572 * psim.c (psim_options): Correct type of dummy arguments being
2573 passed to a device_ioctl call.
2575 * hw_init.c (hw_data_init_data_callback): Adjust printf arguments.
2576 (write_stack_arguments): Ditto.
2577 * hw_trace.c: Instance callback entry no longer a table.
2581 * emul_unix.c (do_unix_umask): Cast printf argument.
2582 (convert_to_linux_termios): Use LINUX_VSWTC not LINUX_VSWCH
2586 * hw_init.c (update_for_binary_section): Abort if we find an
2587 .interp section, which indicates the need for shared libraries to
2592 * emul_unix.c (do_unix_{time,gettimeofday,getrusage}): Add support
2593 for time, gettimeofday, and getrusage system calls.
2594 ({solaris,linux}_descriptors): Add new system calls.
2595 (do_get{,e}{uid,gid}): Use gid_t/uid_t types.
2596 (do_get{,p}pid): Use pic_t types.
2598 * configure.in (AC_TYPE_{GETGROUPS,SIGNAL}): Define.
2599 (AC_TYPE_{MODE,OFF,PID,SIZE,UID}_T): Define.
2600 * config{.in,ure}: Regenerate.
2604 * emul_netbsd.c (emul_netbsd_create): Use the more specific names
2605 `ppc-elf' and `ppc-xcoff' for the stack-type.
2606 * emul_unix.c (emul_unix_create): Ditto.
2607 * emul_bugapi.c (emul_bugapi_create): Ditto.
2608 * hw_init.c: Reconize the new names.
2610 * emul_unix.c (do_unix_break): Adjust so that the updated ioctl
2611 call is used (no system parameter).
2615 * emul_unix.{h,c}: New files to provide Solaris and Linux system
2618 * Makefile.in (LIB_{SRC,OBJ}): Add emul_unix.{c,o}.
2619 (os_emul.o): Depend on emul_unix.h.
2620 (emul_unix.o): New dependency.
2622 * configure.in (--enable-sim-alignment): Add 0|default to mean set
2623 alignment to 0, which means use appropriate alignment for mode.
2624 (AC_CHECK_FUNCS): Add new functions needed by emul_unix.c.
2625 (AC_CHECK_HEADERS): Add new include files needed by emul_unix.c.
2626 * config.in: Regenerate.
2627 * configure: Regenerate.
2629 * emul_generic.c (emul_write2_status): New function to return
2630 results in r3 and r4 for Solaris system calls.
2631 (emul_do_system_call): If the system call is not support, but
2632 there is a string for the system call name, print out the string
2633 instead of the system call number.
2635 * emul_generic.h (emul_write2_status): Declare it.
2637 * emul_netbsd.c: Use /* */ around comment on #endif.
2639 * os_emul.c: Include emul_unix.h.
2640 (os_emulations): Add emulations for Solaris, and Linux.
2642 * psim.c (psim_usage): Add message about solaris, linux
2647 * hw_iobus.c: Tidy up notes so that they can be auto-extracted.
2649 * README: Correct PSIM's title
2653 * basics.h: New global type object_disposition, used to indicate
2654 the status of objects when things are restarted.
2658 * device_table.h: Change the interrupt descriptor structure so
2659 that it includes an additional member - an upper bound on the
2660 interrupts by that name.
2662 * device.c (device_interrupt_decode): Allow a range of interrupt
2663 ports (eg rst0 .. rst6) if the port descriptors bound is non zero.
2665 * device.c (device_tree_print_device): Include a list of valid
2666 interrupt ports when listing supported devices.
2668 * device.h, device.c (device_child_interrupt_*): Delete. Not used.
2670 * emul_generic.c (emul_add_tree_hardware): Modify the creation of
2671 the interrupt net so that it uses int0 .. intN.
2675 * device.h, device.c (device_ioctl): Drop the system argument.
2676 Devices can not obtain this using the device_system() call.
2677 * device_table.h: Adjust accordingly.
2678 * hw_*.c: Adjust accordingly.
2679 * emul_netbsd.c (do_break): Adjust call to vm device accordingly.
2680 * psim.c (psim_options): Use a device_ioctl call to force the
2681 hw_trace device to update the trace options.
2682 * hw_trace.c: Replace the init function with an ioctl call. Adjust
2685 * psim.c (psim_init): Re-order initialization so that the
2686 os-emulation is initialized after the device tree. Without this,
2687 os-emul's are not able to create instances or access properties
2688 that contain an instance handle.
2690 * device.h, device.c (device_add_*_property): Make these functions
2691 internal to device.c. The user has access to the more generic
2692 device_tree_add_parsed function. Differentiate between the initial
2693 and current value for each property.
2694 * (clean_device_properties): New function that deletes any
2695 properties created after the start of a simulation and restores
2696 the initial value of any others (ignoring ihandles).
2697 * (init_device_properties): (Re)Initialize any properties that
2698 contain ihandles. create
2700 * (device_tree_init): Include calls to clean the device tree's
2701 properties and then initialize them. Document this in the device.h
2706 * interrupts.c (decrementer_interrupt): Always pend a decrementer
2707 interrupt even if it is not yet possible to deliver it.
2709 Wed May 1 12:26:51 1996 Andrew Cagney <cagney@benjimen>
2711 * mon.h, mon.c (mon_get_number_of_insns): Make this externally
2712 visable adjusting the arguments so that the interface is correct.
2713 (mon_print_info): Adjust calls.
2715 * registers.h, registers.c (register_description): Add phony
2716 cycle, insn and stall registers.
2718 * psim.c (psim_read_register): Return nr of instructions for given
2723 * hw_htab.c: New file. Extract contents from disk_table.c.
2724 Contains a device that, during initialization will create a
2725 PowerPC htab in memory.
2726 * hw_register.c: New file. Extract contents from disk_table.c.
2727 Contains a device that, during initialization, will parse its
2728 property list and use that to initialize various processor
2729 registers (not target specific).
2730 * hw_vm.c: New file. Extract contents from disk_table.c. Contains
2731 a device that handles accesses to invalid virtual memory addresses
2733 * hw_init.c: New file. Extract contents from disk_table.c. Misc
2734 devices that can initialize memory from a file.
2735 * hw_trace.c: New file. Extract contents from disk_table.c.
2736 Configure trace options from property values.
2738 * Makefile.in (hw_htab.o, hw_register.o, hw_vm.o, hw_init.o,
2739 hw_trace.c): Add new device files.
2741 * device_table.c: Remove above code, now in separate independant
2746 * hw_disk.c: New file. Disk and CDROM device.
2748 * Makefile.in (hw_disk.o): Add device hw_disk.c.
2750 * pk_disklabel.c: New file. Implement the miss-named disk-label
2753 * Makefile.in (pk.h): Create the file pk.h that contains a list of all
2756 * Makefile.in (hw.h, hw.c): Add dependancy on Makefile so that
2757 they are re-created when the makefile is updated.
2759 * emul_generic.c (emul_add_tree_hardware): Add a disk device
2760 (below the iobus) to the device tree. Include an ihandle of
2761 the disk as /chosen/disk.
2763 * emul_bugapi.c (emul_bugapi_create): Don't initialize the input,
2764 output and (new) disk handles yet.
2765 * (emul_bugapi_init): Initialize the input, output (and just added)
2767 * (emul_bugapi_do_diskio): New. Performs disk i/o (well at least
2768 what I think the behavour is).
2769 * emul_bugapi.c (emul_bugapi_instruction_call): Add hook to disk
2770 i/o bug call. For RETURN call, exit using gpr[3]'s status even
2771 though this isn't part of the spec - makes it possible for machine
2772 code to signal the aporting of a simulation run.
2774 * emul_chirp.c (chirp_emul_call_method): Add support for the
2775 claim/release methods.
2776 * (chirp_emul_exit): Add an optional exit status argument to
2777 the exit method. Makes it possible for chirp emul simulations
2778 to abort upon an error.
2779 * device.h, device.c (device_instance_claim,
2780 device_instance_release): New methods for claiming and releasing
2782 * hw_memory.c: add claim and release memory methods.
2783 * hw_*: Use the claim memory method when allocating physical
2788 * hw_nvram.c (hw_nvram_update_clock): Use the current not previous
2789 time when updating the clock.
2791 * hw_nvram.c: Tidy up documentation
2795 * configure.in (AC_STRUCT_ST_{BLKSIZE,BLOCKS,RDEV}): Use these
2796 macros to determine whether or not the appropriate st_<xxx> fields
2797 exist in the stat structure.
2798 (AC_CHECK_FUNCS): Check for all unix system calls used, except for
2799 the real basic ones like open, read, write, etc.
2800 * config{.in,ure}: Regenerate.
2802 * emul_netbsd.c: Add support for missing system calls, and/or
2803 missing stat fields.
2804 (MAXPATHLEN): Undefine if including unistd.h, since sys/param.h
2807 * hw_pal.c (WITH_STDIO): Redefine if O_NDELAY, F_GETFL, or F_SETFL
2809 (scan_hw_pal): Do not cause syntax error if O_NDELAY, F_GETFL, or
2810 F_SETFL not defined.
2814 * emul_netbsd.c (write_stat): Don't convert st_blocks unless the
2819 * configure.in (AC_CHECK_HEADERS): Add sys/ioctl.h.
2820 * config{.in,ure}: Regenerate.
2821 * emul_netbsd.c: If HAVE_SYS_IOCTL_H is not defined, don't include
2826 * hw_pal.c (hw_pal_instance_read_callback): Remove unused
2829 * misc.c ({,target_}a2i): Rewrite to not use strtoul.
2831 * Makefile.in ({spreg,misc}.o): Add dependency on .c file.
2832 ({i,d}gen): Don't link in liberity. Use BUILD_LIBS instead of
2837 * hw_pal.c (hw_pal_instance_read_callback): If using stdio, use
2838 fgets to read line. If not using stdio, do a simple blocking read
2843 * Makefile.in: Correctly build simulator for build machine != host
2848 * configure.in (--enable-hostendian): Rework so the default uses
2849 the AC_C_BIGENDIAN results. Only run AC_C_BIGENDIAN if not cross
2851 * configure: Regenerate.
2853 * sim-endian.h: Add more tests for host endian to support more
2854 platforms in a cross compilation environment.
2858 * hw_pal.c ({scan,write}_hw_pal): If WITH_STDIO == DO_USE_STDIO,
2859 use stdio, instead of unpended read/printf_filtered.
2860 (hw_pal_instance_write_callback): If WITH_STDIO == DO_USE_STDIO,
2861 flush stdout after writing the characters.
2863 * options.c (print_options): Print out WITH_STDIO.
2865 * Makefile.in (STDIO_CFLAGS): Pass on result of @sim_stdio@
2866 configuration variable.
2867 (CONFIG_CFLAGS): Include STDIO_CFLAGS.
2868 (hw.{c,h}): Allow for source dir != build dir, and for HW_SRC
2869 files to contain directory pieces.
2871 * std-config.h (DO{,NT}_USE_STDIO): New flags for whether we
2872 should use stdio for console input.
2873 (WITH_STDIO): If not defined, define as DONT_USE_STDIO.
2875 * configure.in (--enable-sim-stdio): Add new switch to control
2876 whether stdio is used for console I/O.
2877 * configure: Regenerate.
2879 * interrupts.c (external_interrupt): Declare it to be
2880 INLINE_INTERRUPTS, not INLINE_CPU.
2884 * events.c (insert_event_entry): Allow events to be scheduled
2885 *NOW* (at delta time 0). Add assertions to clarify behavour of
2888 * events.c (update_time_from_event): New function. Calculates the
2889 number of ticks from the next event. Use this.
2893 * emul_netbsd.c (do_break): Return 0 if success (instead of
2896 * device_table.c (vm_ioctl_callback): Don't return adjusted break
2901 * device_table.h: Change type of the device ioctl so that it
2902 returns an int (status).
2903 * device.h (device_ioctl): Ditto.
2904 * device.c (device_ioctl): Ditto.
2906 * device_table.c (stack_ioctl_callback): Return 0 status.
2907 (vm_ioctl_callback): Ditto
2911 * emul_netbsd.c (do_read): Correctly set the return value.
2914 (do_geteuid): Ditto.
2916 (do_getegid): Ditto.
2918 (do_sigprocmask): Ditto.
2921 (do_gettimeofday): Ditto.
2922 (do_getrusage): Ditto.
2926 (do___sysctl): Ditto.
2930 * device_table.c (vm_ioctl_callback): Don't access the processor
2931 registers directly, instead leave it to the caller to handle this.
2933 * emul_netbsd.c (do_break): Which calls vm_ioctl_callback to
2934 perform a break. Pass in the new break value and set the
2935 registers according to the result.
2937 * emul_generic.c (emul_write_status): Change so that r3 contains
2938 either status or errno and failure is indicated by SO.
2942 * emul_bugapi.c (emul_bugapi_create): More strict check of OEA
2947 * interrupts.h (interrupts): New structure contains state of
2950 * cpu.c (cpu_interrupts): New function. Pending interrupt status
2951 in the cpu and grant access to it. Add interrupts to cpu
2956 * device.c (device_tree_add_parsed): Check that the creation of a
2957 device instance worked before using it.
2959 * psim.c (psim_halt): Remove cia argument from psim_halt. This
2960 function does not save the CIA so do not pass it in.
2964 * hw_pal.c (hw_pal): Merge the halt and icu and console devices
2965 found in device_table.c into a single hack pal.
2967 * device_table.c (halt, icu, console): Delete.
2969 * Makefile.in (hw_pal.o): New dependency.
2971 * emul_generic.c (emul_add_tree_hardware): Re-arange device tree
2972 so that it uses the pal instead of the icu/halt/console devices.
2973 Wire the pal's interrupt ports up to the cpu nodes.
2977 * hw_iobus.c (hw_iobus_attach_address_callback): Move from
2978 device_table.c to here.
2980 * Makefile.in (hw_iobus.o): New dependency.
2984 * emul_bugapi.c (_os_emul_data): Add fields for output, input.
2985 (emul_bugapi_create): Create input, output from /chosen/stdin and
2987 (emul_bugapi_do_{read,write}): Switch to use device_instance
2989 (emul_bugapi_instruction_call): Change calls to
2990 emul_bugapi_do_{read,write} to pass device instance argument.
2994 * igen.c (idecode_switch_end): Fix 2/26 change so that an extra
2995 default is not written out if a default was already written.
2997 * psim.c (psim_{read,write}_register): Use sizeof unsigned_8 to
2998 size cooked_buf, not sizeof natural_word, since floating point
2999 registers are 8 bytes.
3003 * configure: Regenerate with autoconf 2.9.
3007 * device_table.h: Always include string headers.
3011 * main.c (error): Be careful to not try to print out statistics
3012 when the simulation was never created.
3016 * basics.h: Move the event queue's definition to here so that it
3017 can be refered to globally with out importing all of events.h.
3019 * psim.h, psim.c (psim_event_queue): New function. Grant access
3020 to the simulation event queue. Will make this the single point of
3021 access (there is after all only one event queue in the
3024 * cpu.c (cpu_create): Use psim_event_queue to obtain the event
3025 queue instead of it being passed in. No longer allow access to
3026 the cpu's copy of the event queue.
3030 * events.h, events.c (event_handler): Remove event_queue from
3031 arguments passed to an event handler. That argument is redundant
3032 - the `data' should refer to a data structure that contains the
3033 event queue if queing is needed.
3035 * cpu.c (cpu_decrement_event): adjust
3037 * events.c (event_queue_process): adjust
3041 * device.h, device.c (device_system): New, returns a handle for
3042 the system given the device.
3044 * device.c (device_address_init): Store a pointer back to the
3045 system in each devices node.
3047 * device_table.h: Don't pass `system' into each device when it is
3048 being initialized, this is now available using device_system(me).
3050 * device.c (device_address_init, device_data_init): Adjust.
3052 * hw_cpu.c, hw_nvram.c, hw_memory.c, hw_eeprom.c, device_table.c:
3057 * interrupts.c (decrementer_interrupt, external_interrupt):
3058 Remember that an interrupt wasn't delivered so that it can be
3061 * interrupts.c (check_masked_interrupt): New function. (re)
3062 checks for the posibility that a recent change to the MSR may have
3063 made it possible to deliver an interrupt that was previously
3064 masked be the EE bit.
3066 * ppc-instructions (mtmsr, mfmsr, rfi): Check for posibility of
3067 a pending interrupt being delivered using check_masked_interrupt().
3069 * cpu.c (cpu_decrement_event): Just call decrementer_interrupt()
3070 leaving it to that module to handle both interrupt synchronization
3073 * cpu.c (struct _cpu): remove variables that were going to record
3074 pending decrementer and external interrupts.
3078 * hw_cpu.c, hw_cpu.h: New files. Implement a device that sits
3079 between the interrupt controller and the simulators internal
3080 processor model. Maps device interrupts onto the processor
3081 interrupt function calls.
3085 * hw_nvram.c: NVRAM device that includes a real-time clock that is
3086 updated each second.
3090 * device.h (attach_type): Remove attach_default type address
3091 spaces. Will replace with levels of callback memory.
3093 * corefile.h, corefile.c (new_core_mapping), corefile.c
3094 (core_map_attach): Replace default attach with a layerd callback
3099 * device.c (split_property_specifier): ensure that only a single
3101 (split_value): New function, parses the value part of a device
3104 * device.c (device_tree_add_parsed): Use the interrupt conversion
3105 functions to determine the interrupt port numbers.
3107 * device_table.h: Add table that maps between an interrupts
3108 symbolic name and its port number.
3110 * device.h, device.c (device_interrupt_decode,
3111 device_interrupt_encode): new functions use the recently added
3112 interrupt port name/number tables to perform conversion.
3116 * device.h, device.c (device_set_array_property,
3117 device_set_boolean_property, device_set_ihandle_property,
3118 device_set_integer_property, device_set_string_property): New
3119 functions - allow the value of a given property to be changed.
3121 * device.h, device.c: Re-order declaration and definition of
3126 * device.c (device_tree_print_device, device_tree_add_parsed):
3127 Remove references to phandle properties.
3131 * Makefile.in (corefile.o): missing dependency on device_table.h
3136 * device_table.h: Revamp device init callbacks so that they are a
3138 * device.c (device_init_data, device_init_address): If an init
3139 callback is NULL assume it should do nothing.
3140 * device_table.c (ignore_device_init, unimp_device_init): delete
3142 * device_table.c, hw_memory.c: adjust.
3146 * (device_instance): ditto.
3148 * (address nee config_address): ditto.
3149 * (interrupt): ditto.
3153 * igen.c (idecode_switch_end): Output a default entry when the
3154 switch statement is perfect. Firstly stops GCC complaining about
3155 an incomplete switch and secondly it will be eliminated by a good
3160 * Makefile.in (hw.h, hw.c): New targets. Create from the list of
3161 hw_*.c files. hw.h declares a device descriptor table for each hw
3162 device while hw.c lists those tables in a form suitable for the
3163 construction of a top leveltable in device_table.c.
3165 * Makefile.in (device_table.o): now depends on hw.c a generated
3168 * device_table.c (device_table): Re-arange the table of devices so
3169 that two levels are possible. Make use of hw.c.
3170 * device_table.h: ditto.
3172 * device.c (device_template_create_device): Handle new two level
3173 device lookup table.
3174 * device.c (device_usage): ditto.
3178 * device_table.c: Delete the memory device (moved to hw_memory.c).
3180 * hw_memory.c: New file. Just an OpenBoot memory device.
3184 * device.c (device_init_address): New. Split initialization into
3185 two stages, address and address spaces
3186 * device.c (device_init_data): New. ... and data or other work.
3187 With out this, devices try to modify memory before it as been
3190 * device.c (device_tree_init): Update to perform staged
3193 * device.c (device_init): Delete.
3197 * device_table.c (data_*): Rewrite to make heaver use of property
3198 nodes. Allow initialization by different data types.
3199 * device_table.c (htab_* pte_*): Rewrite to use properties.
3201 * emul_chirp.c (emul_chirp_create): Use
3202 * emul_bugapi.c (emul_bugapi_create): Ditto
3203 * emul_netbsd.c (emul_netbsd_create): Ditto
3207 * emul_generic.c (emul_add_tree_options): Annotate existing tree
3208 with options that haven't yet been specified.
3209 * emul_generic.c (emul_add_tree_hardware): Annotate existing tree
3210 with demo devices and properties.
3212 * emul_chirp.c (emul_chirp_create): Update to use new
3213 device_tree_add_parsed call and additional information now
3214 included in the device tree. Use emul_add_tree* functions to add
3215 any missing details.
3216 * emul_bugapi.c (emul_bugapi_create): Ditto
3217 * emul_netbsd.c (emul_netbsd_create): Ditto
3221 * device.c (device_instance_create): New. Create/delete and
3222 operate on instances of a device.
3223 * device.c (device_instance_delete): Ditto
3224 * device.c (device_instance_read): Ditto
3225 * device.c (device_instance_write): Ditto
3226 * device.c (device_instance_seek): Ditto
3227 * device.c (device_instance_data): Ditto
3228 * device.c (device_instance_name): Ditto
3229 * device.c (device_instance_path): Ditto
3231 * emul_chirp.c (chirp_emul_open): Implement using device_instance.
3232 * emul_chirp.c (chirp_emul_close): Ditto
3233 * emul_chirp.c (chirp_emul_read): Ditto
3234 * emul_chirp.c (chirp_emul_write): Ditto
3235 * emul_chirp.c (chirp_emul_seek): Ditto
3237 * emul_chirp.c (chirp_read_t2h_args): Read arguments from device.
3238 Being careful to convert all from target to host byte order.
3239 * emul_chirp.c (chirp_write_h2t_args): Converse.
3243 * device.c (device_tree_add_parsed): New. Rewrite code to add
3244 devices to the device tree so that a single printf style function
3247 * device.c (device_tree_add_*): Delete. Replaced by above.
3249 * device.c (split_device_specifier): Functions to manipulate a
3250 device specifier (path) breaking it into its components
3251 * device.c (split_property_specifier): Ditto
3252 * device.c (split_device_name): Ditto
3253 * device.c (split_find_device): Ditto
3255 * device.c (scan_*): Delete
3257 * device.c (device_tree_find_device): Rewrite to use above.
3258 * device.c (device_add_property): Ditto
3262 * psim.c(psim_options): Parse the psim options, installing their
3263 value in the device tree. Options are now first entered into a
3264 device tree and then extracted out again when needed. This allows
3265 greater flexability in configuration.
3267 * psim.c (psim_tree): Returns a basic device tree ready for
3268 parsing by psim_options.
3269 * psim.c (psim_usage): New. Give usage to varing levels of detail
3270 according to the verbosity. In turn output device and trace
3273 * main.c (main): Update to use new system
3274 * sim_calls.c (sim_open, sim_do_command): Ditto
3276 * psim.c (psim_options): Add `r' option - ram size.
3277 * psim.c (psim_options): Add `o' option - openboot tree entry.
3278 * psim.c (psim_options): Add `h'/`H' options - more help.
3280 * debug.c (trace_usage): Add more detailed help.
3281 * device.c (device_usage): New. Output help including a list of
3282 the devices currently available in the device table.
3283 * device_table.c: Add usage operator to each device.
3285 * corefile.c (core_create, core_device_create): Adjust so that the
3286 core device is created earlier for psim_tree(). Core can later be
3289 * psim.c (psim_create): Update to handle above way of creating
3290 things. Extract all information from the device tree.
3292 * device_tree.c (trace_*): New device node, its properties are
3293 used to set the value of the trace options. Init this device (in
3294 psim_options) when ever the options are updated.
3298 * debug.h: Add trace_print_info, trace_print_device_tree and
3299 trace_dump_device_tree. The first is a replacement for the
3300 variable `print_info' found in main.c and sim_calls.c. The latter
3301 two enable the dumping of the entire device tree.
3303 * debug.c: Add to trace_description table.
3305 * main.c (main): Use above trace instead of local variable
3306 * sim_calls.c (sim_close): Ditto
3308 * device.c (device_tree_print_device): New. Prints the device
3309 tree in a format that is consistent with what can be parsed by the
3310 device tree load from file code.
3312 * psim.c (psim_create): Dump device tree if enabled. If nump
3313 selected, exit psim immediatly.
3317 * corefile-n.h (core_map_read_N): When mapping from an address to
3318 a device, do not subtract the devices base. The device its self
3319 can do this. Brings the behavour into line with OpenBoot.
3320 * corefile-n.h (core_map_write_N): Ditto
3321 * corefile.c (core_map_read_buffer): Ditto
3322 * corefile.c (core_map_write_buffer): Ditto
3324 * device_table.c (console_io_read_buffer_callback): Adjust to
3325 handle biased address.
3326 * device_table.c (console_io_write_buffer_callback): Ditto
3330 * device.c (attach_device_interrupt_edge): New. Interrupt model
3331 did not allow interrupts to be wired up as a general net (edges).
3332 Re-implement so that interrupt events can be passed to multiple
3333 controllers and interrupt controllers can further propogate
3336 * device.c (attach_device_interrupt_edge) : New, Ditto
3337 * device.c (detach_device_interrupt_edge) : New, Ditto
3338 * device.c (clean_device_interrupt_edges) : New, Ditto
3339 * device.c (device_interrupt_event) : New, Ditto
3340 * device.c (device_interrupt_attach) : New, Ditto
3341 * device.c (device_interrupt_detach) : New, Ditto
3342 * device.c (device_child_interrupt_attach) : New, Ditto
3343 * device.c (device_child_interrupt_detach) : New, Ditto
3345 * device.c (device_attach_interrupt) : Delete old
3346 * device.c (device_detach_interrupt) : Delete old
3347 * device.c (device_interrupt) : Delete old
3348 * device.c (device_interrupt_ack) : Delete old
3350 * device_table.c (unimp_*) : Update to match
3352 * device_table.c (icu_io_write_buffer_callback) : Update to use
3354 * device_table.c (icu_interrupt_event_callback) : Ditto
3358 * device.c (external_to_device) : New function that provides a
3359 standard mapping between a devices internal representation (a
3360 pointer) and its external (or what is passed to a client)
3361 representation (a phandle). Implement using the cap object
3362 attached to the root node.
3364 * device.c (device_to_external) : Ditto
3365 * device.c (external_to_device_instance) : Ditto but for ihandle
3366 and device instance.
3367 * device.c (device_instance_to_external) : Ditto
3369 * Makefile (device.o): Add dependency on cap.
3371 * emul_chirp.c (struct _emul_chirp_data) : Elimate use of cap. Code
3372 needing to translate between internal and external representations
3373 changed to use the external_to_device et.al. device operations.
3374 * emul_chirp.c (chirp_emul_*) : Ditto
3376 * Makefile (emul_chirp.o): Remove dependency on cap
3380 * emul_chirp.c (map_over_chirp_note): Tighten up (and fix) checks
3381 on OpenBoot note section.
3385 * emul_generic.c (emul_write_buffer): Use vm faulting byte
3386 read/write calls for buffer transfers. This will cause a fault to
3387 occure if the transfer fails. CHRP catches the fault while the
3388 others suffer the consequences.
3389 (emul_read_buffer): Ditto.
3390 (emul_write_word): Ditto.
3391 (emul_read_word): Ditto.
3392 (emul_read_string): Ditto.
3396 * emul_chirp.c (emul_chirp_create, emul_chirp_instruction_call),
3397 emul_generic (emul_blr_instruction): Use a real blr instruction to
3398 return from a client service call.
3400 * emul_chirp.c (services): Add all OpenBoot services to table.
3402 * emul_generic.h, emul_bugapi.c (emul_bugapi_create), emul_chirp.c
3403 (emul_chirp_create) : Use names instead of numbers for
3404 instructions being stored in memory.
3408 * Makefile.in (maintainer-clean): Remove .log, core and *.core
3409 (From NetBSD) files.
3413 * ChangeLog.00, ChangeLog: ChangeLog from gdb-4.16 becomes