3 * sim-trace.h, sim-trace.c (trace_prefix): Pass in sim_cia so that
4 trace_prefix can abort cleanly.
8 * dv-sockser.c, dv-sockser.h: New files.
9 * Make-common.in (dv-sockser.o): Add rule for.
10 * aclocal.m4: Check for fcntl.h.
11 * config.h: Add HAVE_FCNTL_H.
13 * sim-break.c (remove_breakpoint): Fix thinko.
15 * sim-hload.c (sim_load): Provide default value of SIM_HANDLES_LMA.
16 Use SIM_HANDLES_LMA for lma_p arg to sim_load_file.
20 * sim-base.h (struct sim_state_base): Add prog_syms and
21 define macro STATE_PROG_SYMS.
22 * sim-trace.c (trace_prefix): Add variables abfd, symsize,
23 symbol_count, and asymbols. Call bfd_get_symtab_upper_bound
24 and bfd_canonicalize_symtab, to get symbol table on first use
25 and preserve it via STATE_PROG_SYMS for future calls to
26 bfd_find_nearest_line.
30 * sim-core.h, sim-core.c (sim_core_map_to_str): Delete.
32 * sim-core.c (sim_core_attach): Handle a generic number of maps -
33 up to nr_maps, not just access_* maps.
35 * sim-profile.h (struct PROFILE_DATA): Track nr_maps different
38 * sim-profile.c (profile_print_core): Make map unsigned. Iterate
39 over nr_maps not sim_core_nr_maps.
41 * sim-events.h, sim-events.c (sim_events_watch_core): Change
42 core_map argument to unsigned.
43 (struct _sim_core): Ditto for struct member core_map.
45 * sim-core.h (nr_sim_core_maps, sim_core_*_map): Delete
47 * sim-basics.h (access_io, access_*_io): Define.
48 (map_read, map_write, map_exec, map_io): Define.
50 * sim-core.c, sim-core.h (sim_core_attach): Replace argument
51 attach with more generic mapmask.
52 (sim_core_{read,write}_*): Change map argument to unsigned.
54 * sim-core.c (sim_core_uninstall, sim_core_attach,
55 sim_core_detach): Iterate over nr_maps instead of
58 * sim-break.c (insert_breakpoint): Write breakpoints to exec_map
59 instead of the write_map.
60 (remove_breakpoint): Ditto.
62 * genmloop.sh (engine_resume_full): Replace sim_core_*_map
63 with read_map, write_map, exec_map resp.
65 * cgen-mem.h (DECLARE_GETMEM, DECLARE_SETMEM, DECLARE_GETIMEM):
68 * cgen-utils.c (sim_disassemble_insn): Ditto.
70 * sim-hrw.c (sim_write, sim_write): Ditto.
72 * sim-utils.h, sim-utils.c (access_to_str, map_to_str,
73 transfer_to_str): New functions.
77 * sim-base.h (sim_state_base): New member environment.
78 (STATE_ENVIRONMENT): New macro.
79 * sim-config.c (current_environment): Delete.
80 (sim_config_default): New function.
81 (sim_config): Set STATE_ENVIRONMENT, not current_environment.
82 * sim-config.h (current_environment,CURRENT_ENVIRONMENT): Delete.
83 (sim_config_default): Add prototype.
84 * sim-module.c (sim_pre_argv_init): Call sim_config_default.
85 * sim-options.c (standard_option_handler, case OPTION_ENVIRONMENT):
86 Set STATE_ENVIRONMENT, not current_environment.
90 * sim-fpu.c (NR_GUARDS64): Change NR_PAD32 to NR_PAD64.
94 * sim-types.h (SIGNED32, SIGNED64): Pacify GCC.
96 * sim-alu.h (ALU64_BEGIN): Make alu64_r unsigned.
100 * Make-common.in (TAGS): Make smarter.
101 * Makefile.in (TAGS): Ditto.
105 * sim-module.c (*): Fix typos in assertion tests.
109 * sim-module.c (sim_pre_argv_init): String passed to asprintf
112 * sim-options.c (sim_parse_args): Ditto.
113 (sim_args_command): Return OK, instead of nothing, for an empty
118 * sim-profile.c (profile_info): Rename from profile_print. Drop
119 misc and misc_cpu callback arguments. Use
120 PROFILE_INFO_CPU_CALLBACK and STATE_PROFILE_INFO_CALLBACK instead.
121 (profile_install): Install profile_info function.
123 * sim-profile.h (PROFILE_INFO_CPU_CALLBACK,
124 STATE_PROFILE_INFO_CALLBACK): Define.
125 (struct PROFILE_DATA): Add field info_cpu_callback.
126 (profile_print): Delete function.
128 * sim-base.h (STATE_MODULES): Define. Replace individual
129 STATE_*_LIST with single struct module_list.
131 * sim-module.h (MODULE_INFO_FN, MODULE_INFO_LIST): Declare.
132 (struct module_list): Declare.
134 * sim-module.h, sim-module.c (sim_module_add_info_fn,
135 sim_module_info): New functions.
136 (sim_module_install): Clean up module data structures.
138 * sim-info.c (sim_info): New file. New function. Call
141 * Make-common.in (sim-info.o): Define rule.
142 (SIM_NEW_COMMON_OBJS): Add sim-info.o.
147 * sim-base.h (sim_cpu_base): New members name, options.
148 (sim_cpu_lookup): Add prototype.
149 * sim-module.c (sim_pre_argv_init): Provide default names for cpus.
150 * sim-options.h (DECLARE_OPTION_HANDLER): New argument `cpu'.
151 (sim_add_option_table): Update prototype.
152 * sim-options.c (sim_add_option_table): New argument `cpu'.
153 (standard_option_handler,standard_install): Update.
154 (sim_parse_args): Handle cpu specific options.
155 (print_help): New static function.
156 (sim_print_help): Call it. Print cpu specific options.
157 (find_match): New static function.
158 (sim_args_command): Call it. Handle cpu specific options.
159 * sim-utils.c (sim_cpu_lookup): New function.
160 * sim-memopt.c (memory_option_handler): Update.
161 (sim_memopt_install): Update.
162 * sim-model.c (model_option_handler): Update.
163 (model_install): Update.
164 * sim-profile.c (profile_option_handler): Update.
165 (profile_install): Update.
166 * sim-trace.c (trace_option_handler): Update.
167 (trace_install): Update.
168 * sim-watch.c (watchpoint_option_handler): Update.
169 (sim_watchpoint_install): Update.
170 * cgen-scache.c (scache_option_handler): Update.
171 (scache_install): Update.
175 * Make-common.in (check): Run `make check' in testsuite dir.
179 * sim-trace.c (trace_result0): New function.
181 * sim-trace.h (TRACE_FP_*, TRACE_FPU_*): Rename TRACE_FPU_*
182 macro's to TRACE_FP_*. TRACE_FPU_* should be defined and used when
183 tracing sim_fpu variables.
184 (TRACE_ALU_RESULT0): Define.
185 (TRACE_FP_RESULT_WORD): Define.
186 (TRACE_FP_INPUT_WORD1): Define.
188 * sim-fpu.c, sim-fpu.h (sim_fpu_max32, sim_fpu_max64, sim_fpu_one,
189 sim_fpu_two): New constants.
190 (sim_fpu_op1, sim_fpu_op2): New types.
191 (struct _sim_fpu): Delete member result. Re-order other members.
192 (sim_fpu_sign, sim_fpu_exp): New functions.
193 (sim_fpu_max, sim_fpu_min): new functions.
194 (EXPMAX32, EXPMAX64, NR_PAD32, NR_PAD64, NR_GUARDS32, NR_GUARDS64,
195 NORMAL_EXPMAX32, NORMAL_EXPMAX64): Define.
199 * sim-profile.c (profile_print): Delete duplicate test of
201 (profile_print_pc): Exit early if data collection not set up.
202 (profile_print_core): Simplify by calling sim_core_map_to_str.
203 * sim-core.h (sim_core_map_to_str): Declare.
204 * sim-core.c (sim_core_map_to_str): Make non-static.
206 * genmloop.sh (engine_resume): Update insn_count before exiting.
207 (engine_resume_full): Keep accurate core profile data.
209 * cgen-utils.c (sim_disassemble_insn): Don't use
210 sim_core_read_aligned_N, it messes up profiling results.
214 * nltvals.def: Regenerate with MN10300 additions.
218 * sim-trace.h (TRACE_ALU_RESULT2): Define.
220 * sim-trace.h, sim-trace.c (trace_result_word2,
221 trace_input_word4, trace_result_word4): New function.
225 * cgen-sim.h (SEM_NEXT_PC): New arg `len'.
227 * sim-xcat.h: Delete.
228 * cgen-mem.h: Delete inclusion of sim-xcat.h.
230 * sim-alu.h: Replace sim-xcat.h with symcat.h.
231 * sim-n-bits.h: Ditto.
232 * sim-n-core.h: Ditto.
233 * sim-n-endian.h: Ditto.
237 * syscall.c (cb_syscall): Handle short reads, and EOF.
241 * sim-trace.c (print_data): case trace_fmt_fp missing break. Use
242 sim_fpu to safely print fp_word values.
243 (print_data): Add trace_fmt_bool and trace_fmt_addr.
244 (trace_result_bool1, trace_result_addr1): New functions.
245 (trace_input_bool1, trace_input_addr1): New functions.
247 * sim-trace.h (TRACE_FPU_*): Define.
251 * sim-fpu.h (enum sim_fpu_class): Add sim_fpu_class_denorm.
252 (sim_fpu_fpto, sim_fpu_tofp): Define.
256 * sim-fpu.c (sim_fpu_cmp): New function.
260 * cgen-utils.h (sim_disassemble_insn): Use CGEN_INSN_BITSIZE
261 instead of abuf->length.
262 * sim-trace.c (trace_options): Have -t only trace a few useful things.
263 (set_trace_option_mask): Renamed from set_trace_options.
264 (set_trace_option): New function.
265 (trace_option_handler): Update calls to set_trace_option{,_mask}.
266 * sim-trace.h (TRACE_USEFUL_MASK): New macro.
270 * sim-basics.h: Declare struct _sim_fpu.
274 * sim-trace.h (TRACE_ALU_INPUT*, TRACE_ALU_RESULT): Define.
275 (trace_prefix, trace_input*, trace_result*): Declare.
276 (trace_one_insn): Change declaration, assume trace_prefix called.
277 (trace_generic): Like trace_one_insn.
278 (TRACE_ALU_IDX, TRACE_*_IDX): Change #define's to enum.
279 (TRACE_alu, TRACE_[a-z]*): Update.
281 * sim-trace.c (trace_prefix, trace_input*, trace_result*,
282 trace_insn, save_data, trace_idx_to_str, print_data): New
284 (trace_one_insn): Rewrite.
285 (trace_generic): New function.
289 * Make-common.in (CGEN_MAIN_SCM): Update.
290 * aclocal.m4 (USE_MAINTAINER_MODE): New variable.
292 * cgen-sim.h (SEMANTIC_CACHE_FN): Delete.
293 (SEMANTIC_FN): Rewrite declaration.
294 (DECODE): Update type of semantic_fast member.
295 ({EX,SEM}_FN_NAME): Have only one version.
296 * cgen.sh: Support building cpu.c.
297 * sim-base.h (sim_state_base): Delete conditionals surrounding
302 * sim-load.c (sim_load_file): Print LMA/VMA according to value
307 * sim-core.c: Add missing prototypes for WITH_DEVICES.
308 Add missing parameters to device_io calls.
309 * sim-core.h: Add missing parameters to device_io calls.
313 * cgen-sim.h (DECODE): Always use switch for `read' for now.
314 (PAREXEC): Renamed from PARALLEL_EXEC. All uses updated.
315 (SEMANTIC{,_CACHE}_FN): Fix return type.
316 * cgen.sh (decode): Add s/@arch@/$arch/.
317 * genmloop.sh (@cpu@_engine_run): Delete `current_state'.
318 (engine_resume): Likewise. Make `engine' volatile. Save copy
319 of cpu pointer in volatile object. Initialize read switch if
324 * cgen-sim.h (EX_FN_NAME): _exc_ -> _ex_.
325 (SEM_INSN): New macro.
329 * sim-run.c (sim_engine_run): Assume IMEM is 32 bit.
333 * configure: Regenerated to track ../common/aclocal.m4 changes.
337 * sim-types.h (fp_word): New type, define according to
338 WITH_TARGET_FLOATING_POINT_BITSIZE.
340 * aclocal.m4 (default_sim_floating_point_bitsize): Add
341 configuration of size of floating point registers.
345 * sim-profile.c (profile_print): Only print CPU <N> if other
346 output is going to appear.
350 * configure: Regenerated to track ../common/aclocal.m4 changes.
354 * sim-types.h (address_word): Typedef according to
355 WITH_TARGET_ADDRESS_BITSIZE.
356 (signed_cell, unsigned_cell, natural_cell): Ditto using
357 WITH_TARGET_CELL_BITSIZE.
359 * sim-config.h (WITH_TARGET_ADDRESS_BITSIZE): Define.
360 (WITH_TARGET_CELL_BITSIZE): Define.
361 (WITH_HOST_WORD_BITSIZE): Delete.
363 * sim-config.c (print_sim_config): Update.
365 * aclocal.m4 (SIM_AC_OPTION_BITSIZE): Add support for
366 configuration of address and OpenFirmware cell sizes.
370 * sim-engine.h (sim_engine_run): Add argument nr_cpus.
371 * sim-run.c (sim_engine_run): Update.
373 * sim-engine.h (SIM_ENGINE_HALT_HOOK): Use SET_CPU_CIA instead of
375 * sim-run.c (sim_engine_run): Ditto.
377 * sim-resume.c (sim_resume): Obtain nr_cpus from sim_engine.
378 (sim_resume): Pass nr_cpus to sim_engine_run.
380 * sim-engine.h (struct _sim_engine): Add member nr_cpus.
382 * sim-engine.c (sim_engine_init): Hardwire nr_cpus to
384 (sim_engine_nr_cpus) sim-engine.c, sim-engine.h: New function
388 * cgen.sh: Portably read parms past $9.
392 * Make-common.in (stamp-tvals): New rule.
393 (targ-vals.h,targ-map.c): Depend on it.
394 (clean): Remove stamp-tvals.
398 * sim-utils.c (sim_state_alloc): #if 0 variable that is only used
399 in code also #if 0'ed.
401 Mon Jan 19 22:26:29 1998 Doug Evans <devans@seba>
403 * configure: Regenerated to track ../common/aclocal.m4 changes.
404 * aclocal.m4: Recognize --enable-maintainer-mode.
408 start-sanitize-cygnus
409 * Make-common.in (cgen-{arch,cpu,decode}): New targets.
412 * cgen-scache.h: Deleted.
413 * Make-common.in (cgen-run.o,cgen-scache.o): Delete cgen-scache.h dep.
414 (CGEN_CPU_SCM): Add sim-model.scm.
415 * cgen-scache.c: Only compile contents if WITH_SCACHE.
416 (scache_init): Use runtime computed size of SCACHE.
417 (scache_flush): Likewise.
418 * cgen-mem.h (GETIMEMU[QHSD]I): Declare.
419 ([GS]ETT{QI,UQI,HI,UHI,SI,USI,DI,UDI}): Declare.
420 * cgen-sim.h: Scache support moved here.
421 (PC): Redo definition.
422 (ARGBUF,SCACHE,PARALLEL_EXEC): Provide forward decls.
423 (DECODE): Add parallel execution support.
424 Only include semantic label members if using switch.
425 (SWITCH,CASE,BREAK,DEFAULT,ENDSWITCH): Portable computed goto support.
426 (CGEN_CPU): Delete members exec_state, halt_sigrc, halt_jmp_buf.
427 (IADDR,CIA,SEM_ARG,EX_FN_NAME,SEM_FN_NAME,RECORD_IADDR,SEM_ARGBUF,
428 SEM_NEXT_PC,SEM_BRANCH_VIA_{CACHE,ADDR},SEM_NEW_PC_ADDR): Moved here
430 (engine_{stop,run,resume,halt,signal}): Delete decls.
431 * cgen-types.h (CGEN_{XCAT3,CAT3}): Delete.
432 (argbuf,scache): Delete forward decls.
433 (STATE): Delete decl.
434 * cgen-utils.c: Don't include decode.h, mem-ops.h, sem-ops.h.
435 Include cgen-mem.h, cgen-ops.h.
436 (engine_halt,engine_signal): Delete.
437 ({ex,exc,sem,semc}_illegal): Delete.
438 (sim_disassemble_insn): Result of extract fn is in bits.
439 * genmloop.sh: Rewrite.
441 * cgen-trace.c (trace_insn): Set printed_result_p=0 if not tracing
444 * sim-base.h (sim_state_base): Delete member `model'.
445 (sim_cpu_base): Add member `model'.
446 * sim-model.h (IMP_PROPERTIES): New type.
447 (MACH): New members imp_props, models.
448 (models): Delete decl.
449 * sim-model.c (set_model): Update.
450 * sim-profile.c (profile_print_model): Update.
452 * sim-utils.c (sim_state_alloc): Delete setting of cpu backlink here.
456 * cgen-trace.c (trace_insn): Call CGEN_INSN_MNEMONIC() rather than
461 * configure: Regenerated to track ../common/aclocal.m4 changes.
466 * aclocal.m4 (AR): Check for sigaction.
470 * Make-common.in (sim-core.o): Depend on $(sim_main_headers).
472 * sim-config.h (WITH_TREE_PROPERTIES): Define as 0.
473 * sim-config.c (sim_config): Replace WITH_DEVICES with
474 WITH_TREE_PROPERTIES.
476 * configure: Regenerated to track ../common/aclocal.m4 changes.
480 * Make-common.in (SIM_ENVIRONMENT): New variable.
481 (CONFIG_CFLAGS): Add it.
482 * aclocal.m4 (SIM_AC_OPTION_ENVIRONMENT): Handle
483 --enable-sim-environment option.
484 * configure: Regenerated.
485 * sim-config.h (environment support): Rewrite.
486 * sim-config.c (current_environment): Define as enum, unconditionally.
487 (current_alignment): Define unconditionally.
488 (config_environment_to_a): Update.
489 (config_alignment_to_a): Fix type of argument. Define unconditionally.
490 (sim_config): Handle environment and alignment determination
491 unconditionally. Delete sanity checks of current_environment,
493 (print_sim_config): Update.
494 * sim-options.c (STANDARD_OPTIONS enum): Add OPTION_ENVIRONMENT.
495 (standard_options): Add --environment.
496 (standard_option_handler): Likewise.
500 * sim-alu.h: Add notes on carry vs borrow for subtraction.
501 (ALU{,8,16,32,64}ADD): Redefine ADD macro as add overflowing.
502 (ALU{,8,16,32,64}ADDC): Define - add carrying.
503 (ALU{,8,16,32,64}SUB): Redefine SUB macro as subtract overflowing.
504 (ALU{,8,16,32,64}SUBB): Define - subtract borrowing.
505 (ALU{,8,16,32,64}SUBC): Define - tract carrying.
506 (ALU{,8,16,32,64}ADD_CA, ALU{,8,16,32,64}ADDC_C): Replace single
507 argument ADD_CA macro with two argument ADDC_C - add carrying with
509 (ALU{,8,16,32,64}SUB_CA, ALU{,8,16,32,64}SUBC_X): Replace single
510 argument SUB_CA macro with two argument SUBC_X - subtract
512 (ALU{,8,16,32,64}SUBB_B): Define - subtract borrowing with
514 (ALU{,8,16,32,64}NEGC, ALU{,8,16,32,64}NEGB): Define.
518 * sim-io.c (sim_io_{syscalls,getstring}): Delete. No longer used.
519 * sim-io.h (sim_io_syscalls): Delete.
523 * syscall.c (cb_syscall): Add missing else, so write to stdout
526 * sim-alu.h (ALU{,8,16,32,64}_SET_CARRY): Provide macros to import
527 the carry bit from the CPU's psw.
531 * gennltvals.sh: Redo syscall support.
532 * nltvals.def: Regenerated.
536 * syscall.c (cb_syscall): If writing to stdout or stderr, flush
537 the stream immediately.
541 * sim-io.c (sim_io_getstring): Delete unused len2.
542 (sim_io_syscalls): Ditto for sys_errno.
546 * syscall.c (cb_syscall): Test CB_SYSCALL struct magic number.
548 * Make-common.in (run.o): Depend on remote-sim.h.
549 (nrun.o,sim-hload.o,sim-hrw.o): Likewise.
550 (sim-io.o,sim-reason.o,sim-resume.o): Likewise.
554 * sim-io.c (sim_io_syscalls): Disable lseek.
559 * gennltvals.sh: Generate syscall values for d30v.
561 * gennltvals.sh: Use libgloss/syscall.h for sparc.
562 * nltvals.def: Regenerate.
564 * callback.c (os_stat): Make 3rd arg a host struct stat ptr.
565 (os_fstat): Likewise. Validate fd argument.
566 (cb_host_to_target_stat): Delete big_p arg. If HS arg is NULL,
567 just compute target stat struct length.
568 * syscall.c: #include "libiberty.h", <sys/types.h>, <sys/stat.h>.
569 (ENOSYS,ENAMETOOLONG): Provide definitions if missing.
570 (get_string): Return host errno values so they can be properly
572 (cb_syscall): Likewise.
573 (cb_syscall, cases open,unlink): Use get_path instead of get_string.
574 (cb_syscall, case read): Use read_stdin for file descriptor 0.
575 (cb_syscall, case write): Use write_stderr for file descriptor 2.
576 (cb_syscall): Add cases for lseek, unlink, stat, fstat, time.
577 (get_path): New function.
581 * sim-io.c (sim_io_syscalls): New function to provide system call
582 emulation. Provide exit, open, close, read, write, lseek, and
584 (sim_io_getstring): New function to return a string from a
585 simulated memory location.
587 * sim-io.h (sim_io_syscalls): Add declaration.
591 * sim-core.c (sim_core_signal): Fix spelling error in message.
593 * sim-hrw.c (sim_read): Use read map, not write map.
595 * Make-common.in (all): Add .gdbinit.
596 * gdbinit.in: Add dump command.
598 * sim-model.c (model_options): Use '\0' for `shortopt'.
600 * sim-trace.c (trace_option_handler): Set state trace file
601 for --trace-file in addition to cpu's values.
602 (trace_vprintf): If cpu == NULL, try state's trace file.
603 (trace_options): Reorganize table, reword some descriptions.
607 * sim-fpu.c (sim_fpu_abs, sim_fpu_neg, sim_fpu_inv), sim-fpu.h:
612 * sim-reason.c (sim_stop_reason): For sim_signalled, return the
613 signal untranslated, document problem with this.
615 * nrun.c (main): Check for a prog name of `*step'. If present,
616 step the simulator instead of allowing it to run free.
618 * sim-signal.c (SIGQUIT): Define on _MSC_VER hosts.
620 * Make-common.in (sim_main_headers): Add sim-signal.h.
624 * sim-signal.c (sim_signal_to_host): Return 0 for SIM_SIGNONE.
628 * sim-signal.h: Start simulator signals at 64 so that host signal
629 numbers can be detected and reported.
631 * sim-signal.h (SIM_SIGFPE), sim-signal.h: Add signal.
635 * callback.c (cb_host_to_target_stat): Fix return values.
637 * cgen-sim.h (enum_signal_type): Delete.
638 (engine_signal): Update prototype.
639 * cgen-utils.c: Don't include <signal.h>.
640 (sim_signal_to_host): Delete, lives in sim-signal.c now.
641 (engine_signal): Update.
643 * sim-utils.c (sim_state_alloc): Call SIM_STATE_ALLOC if defined.
644 (sim_state_free): Call SIM_STATE_FREE if defined.
646 * sim-module.c (sim_module_install): Don't leave any modules
647 installed if one fails to install.
651 * sim-options.c: Don't include ../libiberty/alloca-conf.h any
652 more, since alloca is not used in this file.
654 * sim-alu.h (ALU{32,64}_*): Rewrite 32 and 64 bit ALU support to
655 correctly set the carry and overflow bits for those types.
656 (ALU{8,16,32,64}_{ADD,SUB}_CA): Take VAL argument to add along
657 with carry, so carry is correct after doing both adds.
658 (ALU*): Space out '\' to make it easier to read.
662 * sim-core.c (sim_core_signal): Use sim_stopped instead of
665 * sim-signal.c, sim-signal.h: New files.
666 * Make-common.in (sim-signal.o): Add rule for.
667 (SIM_NEW_COMMON_OBJS): Add sim-signal.o.
668 * sim-abort.c: Don't include <signal.h>.
669 * sim-basics.h: #include "sim-signal.h".
670 * sim-break.c: Don't include <signal.h>.
671 (sim_handle_breakpoint): Replace SIGTRAP with SIM_SIGTRAP.
672 * sim-core.c: Don't include <signal.h>.
673 (SIGBUS): Delete definition.
674 (sim_core_signal): Replace SIGSEGV,SIGBUS with SIM_SIGSEGV,SIM_SIGBUS.
675 * sim-engine.c: Don't include <signal.h>.
676 (sim_engine_abort): Replace SIGABRT with SIM_SIGABRT.
677 * sim-reason.c (sim_stop_reason): Call sim_signal_to_host.
678 * sim-resume.c: Don't include <signal.h>.
679 (SIGTRAP): Delete definition.
680 (has_stepped): Replace SIGTRAP with SIM_SIGTRAP.
681 * sim-stop.c: Don't include <signal.h>.
682 (control_c_simulation): Replace SIGINT with SIM_SIGINT.
683 * sim-watch.c: Don't include <signal.h>.
684 (handle_watchpoint): Replace SIGINT with SIM_SIGINT.
686 * Make-common.in (SIM_NEW_COMMON_OBJS): New variable.
688 * sim-base.h (CIA_ADDR): Provide default definition.
689 * sim-core.c (sim_core_signal): Use CIA_ADDR to fetch value.
690 * sim-break.c (sim_handle_breakpoint): Likewise.
694 * Make-common.in (srccom): New variable.
696 * Make-common.in (DEP, COMMON_DEP_CFLAGS): Define.
697 (LIB_OBJS): Add syscall.o.
698 (gentmap): Pass $(NL_TARGET) to $(CC).
699 (syscall.o): Add rule for.
700 (sim_main_headers): Add $(SIM_EXTRA_DEPS).
701 (sim-bits.o): Depend on $(sim-n-bits_h).
702 (sim-load.o): Depend on callback.h.
704 * Make-common.in (cgen-*.o): Update dependencies, mem-ops.h renamed to
705 cgen-mem.h, sem-ops.h renamed to cgen-ops.h.
706 * cgen-mem.h, cgen-ops.h: New files.
708 * aclocal.m4 (--enable-sim-scache): Pass -DWITH_SCACHE=0 for "=no".
710 * Makefile.in (nltvals.def): Depend on gennltvals.sh.
712 * callback.c: #include string.h or strings.h.
713 #include sys/types.h and sys/stat.h.
714 (cb_init_syscall_map,cb_init_errno_map,cb_init_open_map): Declare.
715 (os_get_errno,os_open): Update.
716 (os_stat,os_fstat): New functions.
717 (os_init): Initialize syscall_map, errno_map, open_map.
718 (default_callback): Add entries for os_stat, os_fstat, syscall_map,
719 errno_map, open_map, signal_map, stat_map.
720 (cb_read_target_syscall_maps): New function.
721 (cb_target_to_host_syscall): New function.
722 (cb_host_to_target_errno): Renamed from host_to_target_errno.
723 (cb_target_to_host_open): Renamed from target_to_host_open.
724 (store): New function.
725 (cb_host_to_target_stat): New function.
726 * syscall.c: New file.
727 * gentmap.c (sys_tdefs): New global.
728 (gen_targ_vals_h): Output target syscall numbers.
729 (gen_targ_map_c): Update. Output target syscall translation map.
730 * gentvals.sh: New first argument `target'. Preface table with
731 #ifdef NL_TARGET_$target if non-null target passed.
732 * gennltvals.sh: New file.
733 * nltvals.def: Regenerated.
737 * sim-n-core.h (sim_core_read_unaligned_N): Return static
739 (sim_core_dummy_M): Declare.
743 * sim-core.c (sim_core_signal): Print the address of the
748 * sim-base.h (sim_state_base): Move `magic' to end of struct.
750 * sim-base.h (sim_state_base): Add member trace_data.
751 (STATE_TRACE_DATA): New macro.
752 * sim-trace.h (TRACE_DEBUG_IDX,TRACE_debug): New macros.
753 ({WITH_,}TRACE_DEBUG_P): New macros.
754 (STATE_TRACE_FLAGS,STRACE_P,STRACE_DEBUG_P): New macros.
755 (_sim_cpu): Delete forward reference.
756 (debug_printf): Update.
757 * sim-trace.c (OPTION_TRACE_DEBUG): Define.
758 (trace_options): Add --trace-debug.
759 (set_trace_options): Handle it.
760 (trace_option_handler): Likewise.
761 (trace_install): Init state trace_data struct.
762 (trace_uninstall): Close state trace file.
763 * sim-events.c (ETRACE): Only print source file and line number if
765 * sim-n-core.h (sim_core_trace_M): Likewise.
767 * sim-core.c (sim_core_signal): Add missing "\n" in message.
771 * sim-n-core.h (sim_core_read_unaligned_N): illegal empty
773 * sim-types.h (unsigned128,signed128): fix typo for MSVC.
777 * aclocal.m4 (SIM_AC_OPTION_SCACHE): Fix typo.
779 * Make-common.in (BUILT_SRC_FROM_COMMON): Remove files no longer
781 (sim-config.o): Remove non-existent $(sim-nconfig_h) dependency.
782 (clean): Don't delete $(BUILT_SRC_FROM_COMMON) if building in
787 * sim-events.c (sim_events_process): Re-compute the time -
788 update_time_from_event - as each event is processed. Reverses
793 * callback.c (os_poll_quit): Replace _WIN32 with _MSC_VER.
797 * sim-events.c (sim_events_process): Delete redundant call to
798 update_time_from_event.
799 (sim_events_slip): Always decrement time_from_event.
800 (sim_events_tick, sim_events_deschedule, update_time_from_event):
801 Delete assertion that time_from_event >=0 when work in queue, no
806 * sim-options.c (STANDARD_OPTIONS): Change OPTION_* to an enum.
807 (standard_option_handler): Update.
809 * sim-options.h: Clarify documentation.
810 (OPTION_LONG_ONLY_P): Delete definition.
811 (OPTION_VALID_P): Define.
813 * sim-options.c (sim_print_help): Allow short only options.
814 (sim_parse_args): Ditto.
815 (sim_args_command): Skip short only options.
816 (sim_parse_args): Allocate space for NUM_OPTS not just 256. Make
817 separate entries for short and long options in the HANDLERS and
819 (sim_parse_args): Disable argument permutation.
823 * sim-core.h (DECLARE_SIM_CORE_WRITE_N. DECLARE_SIM_CORE_READ_N):
824 Add argument M, size of data type.
825 (sim_core_read_misaligned_3, sim_core_write_misaligned_3):
826 Declare, ditto for 5, 6 & 7 byte transfers.
827 (sim_core_write_unaligned_1, sim_core_write_unaligned_1): Define
830 * sim-n-core.h (sim_core_trace_M): Rename from
831 sim_core_trace_N. Add nr_bytes argument. Replace transfer argument
832 with transfer type. Print transfer direction. Handle 1 and 2 byte
834 (sim_core_read_unaligned_N, sim_core_write_unaligned_N): Trace
836 (unsigned_M, T2H_M, H2T_M): Rename from unsigned_N, T2H_N, H2T_N.
837 Update all functions.
839 * sim-core.c: Generate functions starting with 16 not 1.
840 (sim_core_read_unaligned_3): Generate. Ditto for 3 byte write and
841 all 5, 6 & 7 byte transfers.
843 * sim-n-core.h (sim_core_read_misaligned_N,
844 sim_core_write_misaligned_N): Implement.
848 * sim-endian.h (U16_8): Implement
850 * sim-endian.c (sim_endian_split_16, sim_endian_join_16): New functions
852 * sim-endian.h (VL8_16, VH8_16): Implement.
854 * sim-memopt.c (memory_option_handler): Typecast 64bit value to
856 (memory_option_handler): Only zalloc modulo bytes when non-zero.
857 (memory_option_handler): Skip comma in alias address list
861 * sim-memopt.c (do_memopt_add, do_memopt_delete): Add level and
863 (parse_size, parse_addr): New functions
864 (memory_option_handler, memory_options): Parse address & size
865 using new functions. Pass level, space, modulo to do_memopt_add &
868 * sim-memopt.h (struct _sim_memopt): Add level & space fields.
870 * sim-core.h (sim_core_arrach, sim_core_detach): Replace
871 `attach_type attach' argument with `unsigned level' argument.
874 * sim-core.c (new_sim_core_mapping, sim_core_map_attach,
875 sim_core_attach): Replace argument attach with level. Update
876 verification of arguments.
877 (sim_core_map_detach, sim_core_detach): Replace argument attach
880 * sim-basics.h (enum _attach_type): Delete.
884 * sim-core.h (sim_core_write_8): Define.
888 * sim-bits.h: Document ROTn macro.
890 * sim-endian.h (H2T): Handle 16 byte variables.
892 * sim-n-core.h (sim_core_read_unaligned_N): Return a dummy when an
895 * sim-core.c: Do not generate sim_core_*_word.
897 * sim-n-core.h (sim_core_trace_N): Add line_nr argument.
898 (sim_core_write_aligned_N, sim_core_read_aligned_N): Update.
900 * sim-core.h (sim_core_read_unaligned_word,
901 sim_core_read_aligned_word, sim_core_read_word,
902 sim_core_write_unaligned_word, sim_core_write_aligned_word,
903 sim_core_write_word): Change to macros that map onto sim_core_*_N.
907 * sim-n-endian.h: Add TAGS entrys for 16 byte versions.
909 * sim-endian.h: Disable 16 byte support.
913 * sim-endian.c (_SWAP_16): Define. Generate 126 bit swap code.
915 * sim-n-core.h (sim_core_trace_N): New function.
916 (sim_core_read_aligned_N, sim_core_write_aligned_N): Use,
917 (sim_core_read_unaligned_N): Do not retyrn bogus value wden error.
919 * sim-endian.h: Add 128 bit variant.
921 * sim-core.h, sim-core.c: Add 128 bit variant.
923 * sim-types.h: Add signed128 and unsigned128 types using a struct.
927 * sim-events.c (sim_events_process): Clear events->work_pending.
928 (sim_events_tickn, sim_events_tick): Accumulate, instead of
929 setting, nr_ticks_to_process.
930 (sim_events_preprocess): Allow nr_ticks_to_process to be non-zero
931 when the event queue isn't next.
933 * sim-events.h, sim-events.c (sim_events_slip): New function.
937 * sim-hload.c (sim_load): Pass lma_p==0 and do_load=sim_load.
939 * sim-utils.h, sim-load.c (sim_load_file): Add lma_p and do_load
944 * nrun.c (main): Remove useless test of name != NULL.
945 Exit if bfd_openr fails. Call bfd_check_format after bfd_openr.
949 * sim-fpu.c (EXPMAX): Type is unsigned.
950 (MIN_INT, MAX_INT): Type is signed64.
951 (i2fpu): Type of val is signed64.
955 * sim-profile.h (PROFILE_PC_BUCKET_SIZE): Treat a shift of zero as
956 a bucket size of zero.
958 * sim-profile.c (OPTION_PROFILE_PC_GRANULARITY,
959 OPTION_PROFILE_PC): Define.
960 (profile_option_handler): Add support for --profile-pc and
961 --profile-pc-granularity options.
962 (profile_pc_init): When possible, compute nr buckets from bucket
965 * sim-profile.c (profile_pc_init): Align the profile-pc end
966 address with the profile-pc bucket size.
968 * sim-profile.h (PROFILE_PC_NR_BUCKETS): Rename PROFILE_PC_SIZE to
969 something less ambiguous.
970 (PROFILE_PC_BUCKET_SIZE): Ditto for PROFILE_PC_SAMPLE_SIZE.
972 * sim-profile.c (profile_pc_cleanup): New function. Move
973 profile_pc_uninstall code to here.
974 (profile_pc_uninstall): Call.
975 (profile_pc_init): Call.
979 * sim-profile.c (profile_print_pc): Dump pc profile to dmon.out
980 file using BSD gprof format.
982 * sim-bits.h (LSBIT, MSBIT, BIT): Force result to type
984 (LSBIT8, LSBIT16, LSBIT32, LSBIT64, MSBIT8, MSBIT16, MSBIT32,
985 MSBIT64): Force result to unsignedN.
989 * sim-alu.h (ALU16_BEGIN, ALU32_BEGIN, ALU64_BEGIN): Drop opening
991 (ALU8_BEGIN, ALU8_SET, ALU8_ADD, ALU8_SUB, ALU8_NEGATE): Define.
992 (ALU16_ADD, ALU16_SUB, ALU16_NEGATE): Simplify arrithmetic.
993 (ALU32_ADD, ALU32_SUB, ALU32_NEGATE): Simplify arrithmetic.
994 (ALU64_ADD, ALU64_SUB, ALU64_NEGATE): Simplify arrithmetic.
998 * sim-core.h (struct _sim_core_mapping): Change free_buffer to
1001 * sim-core.c (sim_core_uninstall, new_sim_core_mapping,
1002 sim_core_map_attach, sim_core_map_detach): Change free_buffer to
1004 (sim_core_attach): Rename buffer_freed to free_buffer, type
1005 void*. Ensure that allocated buffer is alligned according to
1010 * sim-alu.h (ALU64_HAD_OVERFLOW): Define.
1011 (ALU64_SUB): Define.
1013 * Make-common.in (all): Build SIM_EXTRA_ALL first.
1014 (.gdbinit): Remove dependencies, generate once per build.
1018 * sim-n-core.h (sim_core_read_aligned_N,
1019 sim_core_write_aligned_N): Make xaddr param type address_word not
1024 * sim-fpu.h, sim-fpu.c: Rewrite. Change sim_fpu object to an
1025 unpacked floating point struct. Pass sim_fpu object by reference.
1026 Add preliminary support for rounding modes.
1030 * configure: Regenerated to track ../common/aclocal.m4 changes.
1034 * aclocal.m4 (sim-bitsize): Fix typo, WITH_TARGET_WORD_BITSIZE not
1035 WITH_TARGET_BITSIZE.
1039 * sim-profile.c (profile_print_core): label needs empty statement.
1043 * sim-break.c (sim_set_breakpoint sim_clear_breakpoint): Use ZALLOC
1044 and zfree instead of xmalloc and free. Prevents warnings.
1048 * configure: Regenerated to track ../common/aclocal.m4 changes.
1052 * Make-common.in (SIM_BITSIZE): Assign from configured value.
1053 (CONFIG_CFLAGS): Add SIM_BITSIZE.
1055 * aclocal.m4 (--enable-sim-bitsize): Developer option for
1056 controling the bitsize/msb of the target.
1060 * Make-common.in: New files sim-break.c, sim-break.h.
1061 * sim-base.h: Add point to breakpoint list to sim_state_base.
1062 * sim-break.c sim-break.h: New modules that implement intrinsic
1064 * sim-module.c: Add breakpoint module.
1068 * sim-events.c (SIM_EVENTS_POLL_RATE): poll more often than once
1070 * sim-n-core.h (WITH_XOR_ENDIAN): MSVC barfs on
1072 * sim-core.c (sim_core_xor_write_buffer): WITH_XOR_ENDIAN + 1.
1073 (SIGBUS) define for Windows.
1074 * sim-trace.c (trace_printf,debug_printf): added ALMOST_STDC.
1075 * sim-resume.c: define SIGTRAP for windows.
1076 * sim-xcat.h: use token pasting if ALMOST_STDC.
1080 * Make-common.in (SIM_SCACHE, SIM_DEFAULT_MODEL): Assign
1082 (CONFIG_CFLAGS): Add same.
1086 * sim-types.h (SIGNED64): ##i64 when _MSC_VER, not _WIN32.
1087 (SIGNED32): use ##i32.
1091 * configure: Regenerated to track ../common/aclocal.m4 changes.
1095 * aclocal.m4 (sim-endian): Simplify logic determining [default]
1098 * Make-common.in (SIM_WARNINGS, SIM_ALIGNMENT, SIM_ENDIAN,
1099 SIM_HOSTENDIAN, SIM_RESERVED_BITS, SIM_ASSERT, SIM_FLOAT,
1100 SIM_HARDWARE, SIM_INLINE, SIM_PACKAGES, SIM_REGPARM, SIM_SMP,
1101 SIM_STDCALL, SIM_XOR_ENDIAN): Assign configured values.
1102 (CONFIG_CFLAGS): Add same.
1104 * aclocal.m4: Perform AC_SUBST on optional options.
1108 * sim-config.h (WITH_DEFAULT_ALIGNMENT): Don't hardwire any alignment.
1110 * sim-options.c (standard_option_handler): Typo in warning message.
1112 * sim-base.h (STATE_MODEL): Make conditional on SIM_HAVE_MODEL.
1114 * sim-profile.c (profile_print_insn): Check 0 .. MAX_INSN for any
1115 insn count. Make count conditional on there being a valid
1117 (profile_pc_init): Make default PC profile frequency an arbitrary
1120 * sim-base.h: Ditto.
1122 * sim-profile.h (WITH_PROFILE_MODEL_P): Only enable modeling when
1125 * sim-model.h (struct MACH): Depreciate, to be replaced by bfd
1130 * configure: Regenerated to track ../common/aclocal.m4 changes.
1134 * aclocal.m4 (sim_alignment): Simplify logic for selecting the
1135 configured alignment.
1139 * configure: Regenerated to track ../common/aclocal.m4 changes.
1143 * sim-config.c (sim_config): Check for default alignment.
1145 * sim-options.c (standard_option_handler): Add alignment option.
1147 * aclocal.m4 (sim_alignment): Allow configuration of hardwired and
1148 default alignment requirements on memory accesses.
1152 * sim-load.c (sim_load_file): Return failure if the executable
1153 had no loadable sections.
1157 * sim-events.c (ETRACE): Use trace_printf not sim_io_printf for
1160 * sim-core.c (sim_core_signal): When bad access halt simulator
1161 SIGSEGV / SIGBUS instead of aborting.
1162 (signal.h): Include.
1164 * sim-watch.c (sim_watchpoint_install): Handler for watchpoint
1165 options was missing.
1167 * sim-bits.h (MOVED): Define
1171 * sim-alu.h (ALU32_HAD_OVERFLOW): Pacify GCC, Use MSBIT instead of
1174 * sim-bits.h (LSBIT, MSBIT): Check for overflow of shift value.
1176 * sim-bits.c: Add 8 bit versions of bit macros.
1178 * sim-bits.h: Ditto.
1182 * sim-bits.c (LSSEXT, MSSEXT): Replace SEXT.
1183 (LSINSERTED, MSINSERTED): Ditto for INSERTED.
1185 * sim-n-bits.h (MSSEXTn, LSSEXTn): Replace SEXTn.
1186 (LSINSERTDn, MSINSERTEDN): Ditto for INSERTEDn.
1188 * sim-bits.h (SEXT*): Define as MSEXT/LSEXT.
1189 (INSERTED*): Ditto for LSINSERTED/MSINSERTED.
1193 * aclocal.m4 (SIM_AC_COMMON): Add optional config.h file argument.
1194 configure.in: Output to cconfig.h instead of config.h.
1196 * configure: Regenerated to track ../common/aclocal.m4 changes.
1200 * sim-utils.c (sim_analyze_program): Set STATE_ARCHITECTURE from
1205 * callback.c (os_write): divert stdout and stderr to their
1210 * sim-profile.c (profile_print_speed): Call
1211 sim_events_elapsed_time instead of PROFILE_EXEC_TIME for moment.
1213 * sim-events.c (sim_events_elapsed_time): New function return nr
1214 host MS consumed by the simulator.
1215 (sim_watch_valid): Use.
1217 * sim-module.c (modules): Install sim_events very very early.
1219 * sim-profile.c (profile_print): Call profile_print_pc.
1221 (profile_pc_init): New function, set up processor for PC
1223 (profile_print_pc): New function, print a PC profile.
1224 (profile_pc_event): New function, sample PC.
1226 * sim-profile.h (PROFILE_PC_COUNT, PROFILE_PC_START,
1227 PROFILE_PC_END, PROFILE_PC_SHIFT, PROFILE_PC_SAMPLE_SIZE): Add to
1230 * sim-options.c (sim_print_help): Pacify GCC.
1232 * sim-n-core.h (sim_core_read_aligned_N,
1233 sim_core_write_aligned_N): Add un-conditional profile call.
1234 (sim_core_read_unaligned_N, sim_core_write_unaligned_N): Add
1235 profile call when aligned read/write isn't used.
1237 * sim-base.h: Include sim-profile, sim-model after sim-core &
1238 sim-events allow sim-core to define useful values.
1240 * sim-profile.c (OPTION_PROFILE_CORE): Define.
1241 (profile_option_handler, profile_options): Add support for
1242 --profile-core option.
1243 (print_bar): Include when core profiling.
1244 (profile_print_core): New function, print core profile.
1246 * sim-config.c (print_sim_config): Print profile status.
1248 * sim-profile.h (PROFILE_NEXT_IDX, PROFILE_core,
1249 WITH_PROFILE_PC_P): Define.
1250 (PROFILE_CORE_COUNT): Count each core-map/size separatly.
1251 (PROFILE_COUNT_CORE): Define.
1255 * sim-watch.c (handle_watchpoint): Pass a char** index into the
1256 interrupt_names array as the data.
1257 (sim-watch.h): Document.
1261 * sim-options.c (sim_print_help): When the doc string is to long
1264 * sim-watch.c (sim_watchpoint_install): Use option.doc_name so
1265 that only the first few the watch options are listed. Generate
1266 meanginful usage messages.
1268 * sim-options.h (struct OPTION): Clarify use of doc_name field
1272 * sim-options.c (OPTION_ARCHITECTURE_INFO): New option.
1273 (standard_option_handler): Handle --architecture-info.
1277 * sim-core.h (sim_cpu_core): [WITH_XOR_ENDIAN + 1], to avoid
1278 illegal zero-sized array.
1279 * sim-core.c (sim_core_xor_read_buffer): same.
1283 * nltvals.def: Regenerate.
1287 * sim-fpu.c (DP_FRACHIGH2): Define LL using SIGNED64.
1291 * sim-bits.c (MASKED): Delete.
1292 (EXTRACTED): Delete.
1293 (LSEXTRACTED, MSEXTRACTED): New functions.
1295 * sim-n-bits.h (MASKEDn): Delete, define as MSMASKED or LSMASKED.
1296 (MSMASKEDn, LSMASKEDn): Add last argument.
1299 * sim-bits.h (EXTEND8, EXTEND16): Define.
1300 (EXTRACTED64): Define as 64 bit extract, not 32 bit.
1302 * sim-run.c (sim_engine_run): Use CPU_CIA macro.
1304 * sim-engine.h (SIM_ENGINE_HALT_HOOK): Use CPU_CIA to get at
1305 current instruction address.
1307 * sim-inline.h (*_ENGINE): Define.
1311 * sim-core.c (sim_core_attach): Fix checks of modulo/mask.
1313 * sim-watch.c (delete_watchpoint): Delete by ident and type.
1314 (watch_option_handler): Call delete_watchpoint with ident or type.
1315 (sim_watchpoint_install): Create interrupt specific watchpoint
1316 commands on the fly.
1317 (do_watchpoint_create): New function, create a watch point using
1318 type/int-nr info encoded in the option nr.
1319 (do_watchpoint_info): New function. List active watchpoints.
1321 * sim-watch.h: Change data structure to a list.
1323 * sim-memopt.c (memory_option_handler): Require explicit "all"
1324 before deleting all memory regions.
1326 * sim-utils.c (sim_do_commandf): New function, printf version of
1329 * sim-basics.h (asprintf, vasprintf): Hack, define for CYGWIN32.
1331 * sim-alu.h (ALU64_ADD): Use explicit MSEXTRACTED64, do not assume
1333 (SIGNED64, UNSIGNED64): Delete.
1334 (ALU64_ADD): Don't rely on bit endianness.
1335 (ALU64_BEGIN): Define.
1337 * sim-n-bits.h (MSEXTRACTEDn, LSEXTRACTED): New functions.
1338 (EXTRACTEDn): Delete, define as either LSEXTRACTED or MSEXTRACTED.
1340 * sim-types.h (SIGNED64, UNSIGNED64): New macros, attach relevant
1341 suffix - u64, LL - to 64 bit constants.
1345 * sim-config.c (sim_config): Add assert for SIM_MAGIC_NUMBER.
1347 * sim-utils.h (NZALLOC): Define - zalloc * N.
1349 * sim-hrw.c (sim_read, sim_write): New file. Provide generic
1350 implementation of read/write functions.
1352 * Make-common.in (sim-hrw.o): New target.
1354 * sim-base.h (STATE_MEMOPT_P): Delete, simulators _always_ add
1357 * sim-memopt.c (memory_option_handler): Implement memory-size
1358 command. Implement memory-alias command. Let memory-delete delete
1360 (add_memopt): New function. Add a memory region.
1361 (do_memopt_delete): New function. Delete a memory region.
1363 * sim-utils.c (sim_elapsed_time_get): Never return zero.
1365 * sim-core.c (sim_core_detach): New function.
1366 (sim_core_map_detach): New function. Perform the actual detach.
1367 (sim_core_init): Move initialization code from here.
1368 (sim_core_install): To here.
1369 (sim_core_uninstall): And here.
1371 * sim-module.c: Add memopt module.
1373 * sim-base.h (STATE_MEMOPT, STATE_MEMOPT_P): Add memopt to
1374 simulator base type.
1376 * Make-common.in (sim_main_headers): Add sim-memopt.h
1377 (sim-memopt.o): New target.
1379 * sim-core.c (sim_core_install): Add core_options to the option
1382 * sim-watch.c (watch_options): Make --delete-watch a synonym for
1385 * sim-config.h (WITH_MODULO_MEMORY): Define as 0. Update
1388 * sim-core.h (struct _sim_core_mapping): Change nr_bytes to type
1389 address_word, add mask member.
1391 * sim-core.h, sim-core.c (sim_core_attach): Make nr_bytes of type
1392 address_word, allow for 64bit targets in 32bit host. Add modulo
1394 (sim_core_map_attach): Ditto.
1395 (new_sim_core_mapping): Ditto.
1396 (sim_core_translate): Mask address when modulo memory.
1400 * sim-hload.c (sim_load): Add assert for SIM_MAGIC_NUMBER.
1402 * gdbinit.in: New file.
1403 * aclocal.m4 (SIM_AC_OUTPUT): Build .gdbinit.
1404 * Make-common.in (distclean): Delete .gdbinit.
1405 (.gdbinit): Add rule for.
1406 * configure: Regenerated to track ../common/aclocal.m4 changes.
1408 * Make-common.in (cgen-run.o): Add rule for.
1412 * sim-resume.c (sim_resume): Suspend/resume the simulator.
1414 * sim-events.c (sim_watch_valid): Compute total elapsed time from
1415 both resumed and previous elapsed time.
1416 (sim_events_init): Set initial_wallclock and current_wallclock to
1418 (sim_events_install): Install sim_events_suspend and
1420 (sim_events_watch_clock): Allow for suspended simulator when
1421 computing the time of the clock event.
1423 * sim-events.h (struct _sim_event): Add resume_wallclock, rename
1424 initial_wallclock to elapsed_wallclock, set both to zero.
1425 (sim_events_init, sim_events_uninstall): Delete prototypes.
1427 * sim-module.h (MODULE_SUSPEND_FN, MODULE_RESUME_FN): Define types.
1429 * sim-module.c(sim_module_resume, sim_module_suspend): New
1434 * sim-core.c (sim_core_map_attach): Clarify memory overlap error
1439 * Makefile.in (TAGS): Add support for "/* TAGS: foo */" marker.
1440 * Make-common.in (TAGS): Likewise.
1441 * sim-n-bits.h: Add TAGS comments for all functions.
1442 * sim-n-core.h: Likewise.
1443 * sim-n-endian.h: Likewise.
1447 * sim-utils.c (sim_state_alloc): Set CPU backlinks, callback and
1450 * sim-base.h (sim_state_alloc): Add callback and kind arguments.
1452 * sim-base.h (INVALID_INSTRUCTION_ADDRESS): Add default
1457 * sim-fpu.c (DP_GARDMSB, ...): Make unsigned.
1458 (DP_FRACHIGH, DP_FRACHIGH2, ..): Use MSMASK to avoid LL.
1462 * sim-core.c (sim_core_map_attach): Cast attach enum to int.
1463 (sim_core_xor_read_buffer, sim_core_xor_write_buffer): Make
1464 nr_transfered and nr_this_transfer unsigned.
1466 * sim-events.c (sim_events_tickn): N is signed, as limited to
1469 * sim-n-endian.h (offset_N): Change size to unsigned.
1471 * callback.c (os_poll_quit): Add prototypes for kbhit and getkey.
1475 * sim-utils.c (sim_copy_argv): Delete, replaced by dupargv.
1477 * sim-options.c (sim_parse_args): Use dupargv.
1481 * sim-options.c (standard_option_handler): Use xstrdup, not strdup.
1485 * sim-base.h (STATE_ARCHITECTURE, STATE_TARGET): Add to simulator
1488 * sim-options.c (standard_options): Add --architecture=MACHINE and
1489 --target=TARGET options.
1490 (OPTION_ARCHITECTURE, OPTION_TARGET): Define.
1491 (standard_option_handler): Handle architecture and target options.
1494 * sim-utils.c (sim_analyze_program): Pass STATE_TARGET to
1496 (sim_analyze_program): Set prog_bfd architecture from
1497 STATE_ARCHITECTURE if known.
1501 * configure: Regenerated to track ../common/aclocal.m4 changes.
1506 * aclocal.m4 (enable-sim-warnings): Remove comment stating
1507 that option does not apply to certain files.
1511 * sim-bits.h (LSBIT8, LSBIT16, LSBIT32, LSBIT64, LSBIT, MSBIT8,
1512 MSBIT16, MSBIT32, MSBIT64, MSBIT): New macros - single bit as
1513 offset from MSB/LSB.
1515 * sim-endian.h (A1_8, A2_8, A4_8, A1_4, A2_4, A1_2): New macro,
1516 access address of sub word quantity of a hosts 16, 32, 64 bit word
1518 (V1_2, V1_4, V2_4, V1_8, V2_8, V4_8): Ditto for values.
1519 (U8_1, U8_2, U8_4, U4_1, U4_2, U2_1): Ditto for set of values.
1520 (V2_H1, V2_L1, V4_H2, V4_L2, V8_L4, V8_H4): Given N byte argument,
1521 return N*2 byte value with argument in Hi/Lo word. Renamed from
1522 V1_H2, V1_L2, V2_H4, V2_L4, V4_H8, V4_L8.
1524 * sim-alu.h (ALU32_HAD_OVERFLOW): Use 64 bit mask not 32bit.
1525 (ALU16_HAD_CARRY, ALU32_HAD_CARRY, ALU16_HAD_OVERFLOW): Use MSBIT
1526 so that bit offset is explicit.
1530 * sim-utils.c (sim_analyze_program): Add prog_name argument.
1531 Update STATE_PROG_BFD when needed with a dup'd copy of the
1534 * sim-config.c (sim_config): Delete ABFD argument, use
1535 STATE_PROG_BFD directly.
1539 * run.c (main): Pass the open ABFD to sim_create_inferior.
1541 * nrun.c (main): Determine prog_bfd. Pass to sim_create_inferior
1545 * sim-hload.c (sim_load): New file. Implement generic sim_load for
1546 hardware only simulator targets.
1548 * Make-common.in (sim-hload.o): Add rule.
1552 * sim-utils.c (sim_copy_argv): Rewrite to match malloc strategy
1553 used by copyargv and freeargv.
1555 * sim-options.c (sim_parse_args): Save a copy of PROG-ARGS in
1556 STATE_PROG_ARGV, not just a pointer.
1560 * configure: Regenerated to track ../common/aclocal.m4 changes.
1565 * aclocal.m4 (sim-endian): Add second argument to
1566 SIM_AC_OPTION_ENDIAN. First is hardwired endian, second is
1567 default endian when not hardwired.
1569 * sim-config.h (WITH_DEFAULT_TARGET_BYTE_ORDER): New macro, if all
1570 else failes value for target byte order.
1572 * sim-config.c (sim_config): Add abfd arguments. Set
1573 STATE_PROG_BFD accordingly. Determine prefered_target_byte_order
1575 (sim_config): Return SIM_RC, don't abort.
1578 * run.c (main): Update call to sim_open - add ABFD argument.
1579 * nrun.c (main): Add NULL ABFD argument.
1583 * callback.c (os_poll_quit): Make static.
1584 Call sim_cb_eprintf, not p->eprintf.
1585 (sim_cb_printf, sim_cb_eprintf): New functions.
1586 * sim-utils.h (sim_cb_printf, sim_cb_eprintf): Declare.
1588 * sim-basics.h (zalloc,zfree,sim_add_commas,SIM_ELAPSED_TIME,
1589 sim_elapsed_time_get,sim_elapsed_time_since): Move decls to
1590 sim-utils.h. #include sim-utils.h.
1591 * sim-utils.h: Above decls moved here.
1592 (sim_analyze_program,sim_load_file): Use `struct _bfd', not `bfd'.
1594 * sim-watch.c (action_watchpoint): Fix thinkos.
1598 * sim-types.h: Fix defs of 64 bit data types for MSVC.
1602 * sim-n-core.h (sim_core_write_unaligned_N): Add missing break
1603 to FORCED_ALIGNMENT case.
1607 * callback.c (target_to_host_open): Handle hosts with O_BINARY.
1611 * Make-common.in (libsim.a): Fix typo.
1615 * nrun.c (main): Verify the structure returned before using it.
1619 * sim-config.h (WITH_ENGINE): Enable the sim-engine module by
1622 * sim-engine.c (sim_engine_install): New function. Install the
1623 engine init functions.
1624 (sim_engine_init): [Re]initialize the simulator engine.
1626 * sim-module.c: Add sim_engine to list of modules that always
1631 * sim-watch.c (schedule_watchpoint): Use sim_unschedule_watchpoint
1632 to remove the old watchpoint, not delete_watchpoint.
1633 (watch_option_handler): Action the correct watchpoint, not just
1638 * sim-n-core.h (sim_core_write_aligned_N): For 8byte reads, output
1639 both low and high word.
1640 (sim_core_write_aligned_N): Ditto.
1642 * sim-trace.c (set_trace_options): Delete code explicitly setting
1645 * sim-options.c (sim_print_help): Call the list commands if not a
1646 standalone simulator.
1647 (sim_print_help): Advise that some options may not be applicable.
1649 * sim-trace.c (set_trace_options): Assume core present.
1651 * sim-events.c (sim_events_schedule_after_signal): Overflow signal
1652 buffer when full not almost full.
1656 * sim-events.c (sim_events_process): Don't blat the event queue
1657 when processing watchpoints.
1659 * sim-watch.h: Make arg unsigned long - stop sign extension.
1661 * sim-events.c (sim_watch_valid): rewrite so debugable.
1663 * sim-config.h (WITH_XOR_ENDIAN): Default to zero.
1665 * sim-watch.c (schedule_watchpoint): Add is_within option so that
1666 inequality test is possible.
1667 (handle_watchpoint): Re-pass is_within arg.
1668 (watch_option_handler): When `!' prefix to pc-watchpoint arg pass
1669 0 to schedule_watchpoint's is_within arg.
1670 (sim_watchpoint_init): Re-pass is_within arg.
1672 * sim-options.c (sim_print_help): Add is_command argument. Don't
1673 include -- prefix when called from the command line interpreter.
1675 * sim-watch.c (schedule_watchpoint): Pass true is_within argument.
1677 * sim-events.c (sim_events_watch_sim): Add is_within argument,
1678 zero indicates that the test should be reversed.
1679 (sim_events_watch_core): Ditto.
1680 (WATCH_CORE): Compare range against is_within.
1685 * sim-events.c (WATCH_CORE): Pass NULL cpu argument to
1686 sim_core_read_buffer. Check nr-bytes transfered.
1688 * sim-core.h (sim_core_common): Define a new struct that contains
1689 the common data. to sd and cpu structures.
1690 * sim-core.c (sim_core_attach): Update.
1691 (sim_core_init): Update. Remember to copy initialized data to each
1693 (sim_core_find_mapping): Ditto.
1695 * sim-core.c (sim_core_read_buffer): Add cpu argument.
1696 (sim_core_write_buffer): Ditto.
1698 * sim-n-core.h (sim_core_read_unaligned_N): When mis-aligned
1699 transfer use xor version of read buffer.
1700 (sim_core_write_unaligned_N): Ditto for write.
1702 * sim-core.c (sim_core_xor_read_buffer): New function implement
1703 xor-endian data read breaking transfer up into xor-endian sized
1705 (sim_core_xor_write_buffer): Ditto for write.
1706 (reverse_n): Reverse order of arbitrary number of bytes in buffer
1707 - needed for xor-endian transfers.
1711 * sim-inline.h: Review description.
1713 * sim-core.h, sim-core.c: Reduce number of functions being inlined
1714 to just those involved in data transfers and configuration.
1716 * sim-xcat.h (XSTRING): New macro, map macro definition onto
1718 * sim-n-core.h (sim_core_read_aligned_N): Use.
1719 (sim_core_read_unaligned_N): Ditto.
1720 (sim_core_read_unaligned_N): Ditto..
1721 (sim_core_write_unaligned_N): Ditto.
1723 * sim-core.h: Add xor endian bitmap to main structure. *
1725 sim-n-core.h (sim_core_write_aligned_N): Add suport for xor
1727 (sim_core_read_aligned_N): Ditto.
1729 * sim-core.c (sim_core_set_xor_endian): New function.
1730 (sim_core_attach): Don't overwrite the per-cpu xor map when
1731 cloning the global core.
1735 * sim-engine.h: Update below so that it is using an enumerated
1740 * sim-engine.c (sim_engine_restart):
1741 * sim-resume.c (sim_resume): Change longjmp param/setjmp
1742 return value used for simulator restart from 0 to 2.
1746 * cgen-scache.c (scache_option_handler): Add is_command arg.
1748 * sim-model.c (model_option_handler): Add is_command argument.
1750 * sim-profile.c (profile_option_handler): Add is_command arg.
1752 * sim-events.c (sim_watch_valid): Use ub64, lb64 when 64bit value
1755 * sim-module.c (sim_module_add_init_fn): Call init fn in the same
1756 order that they are registered.
1758 * sim-options.h (OPTION_HANDLER): Add argument to differentiate
1759 between option and command line processing.
1761 * sim-options.c: Include stdlib.h, ctype.h.
1763 * Make-common.in (sim-watch.o): Add rule.
1764 (sim_main_headers): Assume sim-assert.h included.
1765 (sim-*.o): Simplify make rule.
1767 * sim-module.c: Add sim_watch_install to module list.
1771 * sim-base.h (STATE_LOADED_P): New predicate. Set once everything
1774 * sim-trace.c (trace_install): Check magic. Include sim-assert.h.
1775 * sim-events.c (sim_events_install): Ditto.
1776 * sim-core.c (sim_core_install): Ditto.
1777 * sim-model.c (model_install): Ditto.
1778 * sim-options.c (standard_install): Ditto.
1779 * sim-profile.c (profile_install): Ditto.
1780 * sim-reason.c (sim_stop_reason): Ditto.
1781 * sim-run.c (sim_engine_run): Ditto.
1782 * sim-utils.c (sim_analyze_program): Ditto.
1784 * sim-module.c (modules): Make profile_install and trace_install
1787 * sim-base.h (STATE_MEM_BASE): Define for flat memory systems.
1789 * sim-options.c (standard_option_handler): Set the byte order.
1791 * sim-events.c (sim_events_process): Allow multi tick processing.
1792 (sim_events_tickn): New function - multi cycle tick.
1794 * sim-events.h (sim_events_tickn, sim_events_timewarp): Add
1795 prototypes. Under development.
1796 (sim_events): Replace processing with nr_ticks_to_process.
1800 * nrun.c (main): Pass callbacks to sim_open instead of using
1803 * run.c (main): Ditto.
1807 * sim-events.c (sim_events_zalloc): Signal save memory allocator -
1808 stop tk interrupting malloc calls.
1809 (sim_events_zalloc): Converse.
1811 * Make-common.in (sim_main_headers): Add sim-events.h.
1813 * sim-events.c (sim_events_schedule_after_signal): Change return
1814 type to void - signal events are strictly internal.
1815 (sim_events_init): Allocate a finite buffer for signal events.
1816 (sim_events_schedule_after_signal): Enter signal events into the
1819 * sim-engine.c (sim_engine_halt): Check SIM_DESC magic.
1820 (sim_engine_restart): Ditto.
1821 (sim_engine_abort): Ditto.
1822 * sim-stop.c (sim_stop): Ditto.
1823 (control_c_simulation): Ditto.
1824 * sim-resume.c (sim_resume): Ditto.
1825 (has_stepped): Ditto.
1826 * sim-abort.c (sim_engine_abort): Ditto.
1828 * sim-basics.h (transfer_type): New type.
1830 * sim-core.c (sim_core_signal): New function. Print core signal
1832 (sim_core_find_mapping): Add transfer argument.
1834 * sim-n-core.h (sim_core_{write,write}_unaligned_N): Call
1835 SIM_CORE_SIGNAL if a recoverable abort.
1836 * sim-core.c (sim_core_find_mapping): Ditto.
1840 * sim-core.c (sim_core_find_mapping): Replace calls to
1841 sim_io_error to more resiliant sim_engine_abort.
1843 * sim-n-core.h (sim_core_read_unaligned_N): Ditto.
1844 (sim_core_write_unaligned_N): Ditto.
1848 * sim-module.c: Add sim_events_install to list.
1850 * sim-events.c (sim_events_install, sim_events_uninstall): Clonse
1852 (sim_events_init): Now returns SIG_RC.
1854 * sim-run.c: New file. Generic sim_engine_run.
1855 * sim-reason.c: New file. Generic sim_stop_reason.
1856 * sim-stop.c: New file. Generic sim_stop.
1857 * sim-resume.c: New file. Generic sim_resume.
1859 * Make-common.in (sim-engine.o): Add rule.
1860 (sim-run.o, sim-reason.o, sim-stop.o, sim-resume.o): Ditto.
1862 * sim-engine.h, sim-engine.c: New file. Provide generic
1863 implementation of sim_engine_halt, sim_engine_error. et.al.
1865 * sim-base.h (sim_state_base): Add member halt.
1866 (sim-engine.h): Include.
1868 * sim-events.h (sim_event_handler): Always pass SIM_DESC to event
1870 * sim-events.c (sim_events_poll): Update event handler.
1874 * sim-events.h, sim-events.c (sim_events_watch_clock): New
1876 (sim_events_watch_sim): New function.
1877 (sim_events_watch_core): New function.
1878 (sim_watch_valid): New function.
1879 (sim_events_preprocess): New function.
1880 (sim_events_process): Process the watchpoints as well as the timer
1882 (sim_events_tick): Check WORK_PENDING instead of the hold queue.
1883 (sim_events_deschedule): Check all the queues when removing an
1885 (sim_events_init): Ditto for cleaning.
1889 * sim-fpu.c (is_ufpu_number): Comment out - currently unused.
1893 * callback.c (os_open): Type of arg flags is int.
1897 * sim-fpu.c (sim_fpu_is_{eq,ne,lt,le,gt,ge}): Compare Infinities
1898 just like normal numbers as per IEEE rules.
1902 * callback.c (os_close): Mark the descriptor as being
1903 available if the close succeeded.
1904 (os_open): Pass 0644 as the mode of the file being created.
1908 * sim-fpu.c (pack_fpu, unpack_fpu): New functions - decode a
1911 * sim-inline.c (SIM_INLINE_C): Rename from _SIM_INLINE_C_.
1912 * sim-lnline.h: Update.
1914 * sim-fpu.h, sim-fpu.c (sim_fpu_[iu]{32,64}to): New int2fp
1915 conversion functions.
1916 (sim_fpu_to{32,64}[iu]): New fp2int functions.
1918 * sim-fpu.h, sim-fpu.c (sim_fpu_is_{lt,le,eq,ne,ge,gt}): New fp
1919 compare functions. Replacing.
1920 (sim_fpu_cmp): This. Delete.
1924 * sim-core.c (sim_core_find_mapping): Call engine_error not
1925 sim_io_error when possible.
1929 * sim-endian.h (V1_H2): Add macro's to insert a word into a
1930 high/low double word.
1932 * sim-trace.h: Remove definition of attribute - defined in
1937 * sim-options.h (struct OPTION): Add doc_opt as the documenting
1938 name of the option - or family of options.
1940 * sim-options.c (sim_args_command): Match command `a-b c' with
1941 option `--a-b-c' from option table.
1945 * sim-options.c (sim_print_help): For optional arguments, wrap
1948 * sim-trace.c (set_trace_options): New function, handle optional
1949 argument and multiple assignment.
1950 (trace_option_handler): Update.
1952 * sim-trace.c (trace_option_handler): Trace branch and not fpu
1953 when branch tracing selected.
1957 * sim-trace.c (trace_one_insn): Make a va-args function.
1959 * sim-trace.c (trace_vprintf): New function, va-arg version of
1964 * sim-trace.c (trace_uninstall): Don't close a file twice.
1965 * sim-profile.c (profile_uninstall): Likewise.
1969 * sim-trace.c (toplevel): Include bfd.h.
1970 (trace_options): Note that --trace-linenum also turns on
1971 --trace-insn. Add --trace-{branch,semantics}.
1972 (trace_option_handler): If --trace-linenum, also turn on
1973 --trace-insn. Add --trace-branch support. If --trace-semantics,
1974 turn on ALU, FPU, branch, and memory tracing.
1975 (trace_one_insn): New function to trace an instruction. Support
1977 (OPTION_TRACE_*): Use an enum, rather than lots of defines.
1979 * sim-trace.h (TRACE_{SEMANTICS,BRANCH}_IDX): Add new macros.
1980 (MAX_TRACE_VALUES): Use 32, not 12 by default.
1981 (TRACE_branch): Add new mask.
1982 (TRACE_*_P): Define all possible trace_p macros.
1983 (trace_one_insn): Declare function.
1987 * sim-trace.h (__attribute__): Define as nothing if not GNU C or
1988 GNU C doesn't support __attributes__.
1989 ({trace,debug}_printf): Add attribute's so -Wformat can check the
1994 * sim-config.h (FORCED_ALIGNMENT): New alignment option -
1995 addresses are masked forcing them to be correctly aligned.
1996 (WITH_ALIGNMENT): Make NONSTRICT_ALIGNMENT the default.
1997 * sim-config.c (config_alignment_to_a): Update.
1999 * sim-core.h (sim_cpu_core): New data type contains cpu specific
2001 * sim-base.h (CPU_CORE): Add cpu specific core data to cpu base
2003 * sim-core.c (sim_core_attach): Add CPU argument. Ready for
2004 processor specific core maps.
2005 (sim_core_map_attach): Copy the core map data to each of the
2006 processor specific core data structures.
2007 * sim-core.c (sim_core_find_mapping): Update.
2009 * sim-n-core.h (sim_core_read_N, sim_core_write_N): Rename.
2010 (sim_core_write_aligned_N, sim_core_write_aligned_N): New names.
2011 (sim_core_write_unaligned_N, sim_core_write_unaligned_N): New
2012 alternatives that handle unaligned addresses.
2013 (sim_core_{read,write}_{,un}aligned_N): Drop SIM_DESC arg, replace
2015 * cgen-utils.c (sim_disassemble_insn): Update.
2019 * sim-trace.h (TRACE_FPU_IDX): Add Floating-point specific
2022 * sim-fpu.h, sim-fpu.c: New files - prototype for generic target
2025 * sim-inline.h, sim-inline.c: Add support for SIM_FPU.
2029 * sim-core.c (sim_core_map_to_str): New function ascii equivalent
2032 * sim-n-core.h (sim_core_read_N, sim_core_write_N): Use in trace
2037 * cgen-trace.c: Prepend additional trace_printf argument.
2039 * cgen-utils.c (sim_disassemble_insn): Add additional core
2044 * nrun.c (main): Catch/report errorenous simulator states.
2046 * sim-module.c: #include "libiberty.h" so that xmalloc is defined.
2047 * sim-trace.c: #include string.h/strings.h so that memset is
2049 * sim-utils.c: Ditto.
2050 * sim-profile.c: Ditto. And stdlib.h.
2051 (print_bar): Only define when used by instruction or memory profiler.
2053 * sim-options.c (standard_option_handler): Make ul more local.
2055 * sim-load.c (sim_load_file): Make the name constant.
2056 (sim_load_file): Passify gcc.
2058 * sim-utils.h: New file, pre-declare utilites in corresponding .c
2060 * sim-utils.c, sim-load.c: Include sim-utils.h.
2062 * sim-base.h (sim_cpu): Pre define here so available to all.
2064 * sim-core.h (DECLARE_SIM_CORE_WRITE_N, DECLARE_SIM_CORE_READ_N):
2065 Restore the sim_cpu and instruction_address arguments so that full
2066 information is available to the abort function.
2067 * sim-core.c (sim_core_find_mapping, sim_core_write_buffer): Ditto.
2068 * sim-n-core.h (sim_core_write_N, sim_core_read_N): Update.
2070 * sim-trace.h, sim-trace.c (trace_option_handler): Add interim
2071 tracing support for sim-events and sim-core.
2072 (trace_option_handler): Convert #if to if where possible so always
2073 compiled/checked by C compiler.
2074 * sim-n-core.h (sim_core_write_N, sim_core_read_N): Update.
2076 * sim-base.h: Adjust comment documenting how to define the cpu
2078 (sim_state_base): Add sim_core and sim_events to simulator base
2081 * sim-trace.h, sim-trace.c (trace_printf): Add SIM_DESC argument.
2082 * sim-core.c (sim_core_init, sim_core_attach,
2083 sim_core_find_mapping): Update.
2084 * sim-events.c (ETRACE, sim_events_init, sim_events_time,
2085 update_time_from_event, insert_sim_event,
2086 sim_events_schedule_after_signal, sim_events_deschedule,
2087 sim_events_tick): Ditto.
2089 * sim-basics.h (sim-module.h, sim-trace.h, sim-profile.h,
2090 sim-model.h): Move #includes from here.
2091 * sim-base.h: To here.
2092 (sim-core.h, sim-events.h, sim-io.h): Include also
2096 * callback.c (default_callback): Missing initialisers.
2100 * sim-utils.c (sim_add_commas): New function.
2101 * sim-basics.h (sim_add_commas): Add prototype.
2102 * cgen-scache.c (scache_print_profile): Print commas in numbers.
2103 * sim-profile.c (COMMAS): New macro.
2104 (print_*): Use it to print commas in numbers.
2106 * configure: Regenerated.
2108 * cgen-sim.h (sim_signal_type): Add SIM_SIGINT.
2109 (cgen_state): New member run_fast_p.
2110 (cgen_init): Add prototype.
2111 (sim_disassemble_insn): New arg `cpu'.
2112 * cgen-trace.c (trace_insn): Update call to sim_disassemble_insn.
2113 * cgen-utils.c (cgen_init): New function.
2114 (sim_disassemble_insn): New arg `cpu'. Rewrite fetching of insn.
2115 * genmloop.sh: Call engine_halt if loop exits.
2117 * Makefile.in (sim-options_h): Define.
2118 (sim-{module,options,trace,profile,utils}.o): Clean up dependencies.
2119 (sim-model.o): Add new rule.
2120 (cgen-{scache,trace,utils}.o): Add new rules.
2121 * aclocal.m4 (SIM_AC_OPTION_{SCACHE,DEFAULT_MODEL}): Add.
2122 * cgen-scache.c (scache_print_profile): Change `sd' arg to `cpu'.
2123 Indent output by 2 spaces.
2124 * cgen-scache.h (scache_print_profile): Update.
2125 * cgen-trace.c (trace_insn_fini): Indent output by 2 spaces.
2126 Use trace_printf, not fprintf.
2127 (trace_extract): Use trace_printf, not cgen_trace_printf.
2128 * genmloop.sh (!FAST case): Increment `insn_count'.
2129 * sim-base.h (sim_state_base): Only include scache_size if WITH_SCACHE.
2130 (sim_cpu_base): Rename member `sd' to `state' to be consistent with
2131 access macro's name.
2132 * sim-core.c (sim_core_init): Use EXTERN_SIM_CORE to define it.
2133 Change return type to SIM_RC.
2134 (sim_core_{install,uninstall}): New functions.
2135 * sim-core.h (sim_core_{install,uninstall}): Declare.
2136 (sim_core_init): Use EXTERN_SIM_CORE to define it.
2137 Change return type to SIM_RC.
2138 * sim-model.h (models,machs,model_install): Declare.
2139 * sim-module.c (modules): Add scache_install, model_install.
2140 (sim_post_argv_init): Set cpu->state backlinks.
2141 * sim-options.c (standard_options): Delete --simcache-size,--max-insns.
2142 (standard_option_handler): Likewise.
2143 * sim-profile.c (PROFILE_{HISTOGRAM,LABEL}_WIDTH): Move to
2146 (profile_options): Delete --profile-simcache.
2147 (profile_option_handler): Likewise.
2148 (profile_print_insn): Change `sd' arg to `cpu'. Indent output 2
2150 (profile_print_{memory,model}): Likewise.
2151 (profile_print_simcache): Delete.
2152 (profile_print_speed): New function.
2153 (profile_print): Rewrite.
2154 * sim-profile.h (PROFILE_scache): Renamed from PROFILE_simcache.
2155 (WITH_PROFILE_SCACHE_P): Renamed from WITH_PROFILE_SIMCACHE_P.
2156 (PROFILE_DATA): Delete members simcache_{hits,misses}.
2157 (PROFILE_COUNT_SIMCACHE_{HIT,MISS}): Delete.
2158 (PROFILE_{CALLBACK,CPU_CALLBACK}): New types.
2159 (profile_print): Update prototype.
2163 * cgen-scache.[ch], cgen-sim.h: New files.
2164 * cgen-trace.[ch], cgen-types.h, cgen-utils.c, genmloop.sh: New files.
2165 * sim-model.c: New file.
2167 * Make-common.in (clean targets): Undo patch of Apr. 22.
2171 * sim-n-bits.h (signed): If we have a standard compiler, undef
2172 signed, so that signedN is defined correctly.
2176 * sim-module.h, sim-model.h, sim-profile.h: New files.
2177 * sim-module.c, sim-profile.c: New files.
2178 * Make-common.in (SIM_PROFILE): Define
2179 (CONFIG_CFLAGS): Add $(SIM_PROFILE).
2180 (sim_main_headers): Add sim-module.h, sim-model.h, sim-profile.h.
2181 (sim_module.o,sim-profile.o): Add rules for.
2182 * aclocal.m4 (--enable-sim-trace): Allow symbolic arguments.
2183 (--enable-sim-profile): Add.
2184 * configure: Regenerated.
2185 * sim-base.h (sim_state_base): New members init_list, uninstall_list,
2186 model. Move trace and profile support to sim-{trace,profile}.h.
2187 New members trace_data, profile_data.
2188 * sim-basics.h: #include sim-module.h, sim-model.h, sim-profile.h.
2189 * sim-config.h: Provide default definition of WITH_PROFILE.
2190 (WITH_TRACE): Change default to -1.
2191 (MAX_NR_PROCESSORS): Always define.
2192 * sim-options.c: Move trace and profile support to
2193 sim-{trace,profile}.h.
2194 (sim_pre_argv_init): Moved to sim-model.c.
2195 (standard_install): New function.
2196 * sim-options.h (sim_pre_argv_init): Move decl to sim-model.c.
2197 (standard_install): Declare.
2198 * sim-trace.c: Tracing option handling moved here from sim-options.c.
2199 (trace_install, trace_uninstall): New functions.
2200 (trace_printf): Update reference to TRACE_FILE.
2201 * sim-trace.h (TRACE_FOO_IDX): Moved here from sim-base.h.
2202 (TRACE_foo): Bit masks for symbolic arguments to --enable-sim-trace.
2203 (WITH_TRACE_FOO_P): Define.
2204 (trace_install): Declare.
2205 (TRACE_DATA): New struct.
2209 * run.c: Undo last exec_bfd patch.
2210 (main): Only pass -E ifdef SIM_HAVE_BIENDIAN.
2214 * run.c (exec_bfd): Add back in.
2215 (main): Set exec_bfd.
2219 * sim-load.c (sim_load_file): #include <stdio.h> for NULL.
2223 * sim-events.c (insert_sim_event): Call sim_io_error instead of
2224 less well defined engine_error.
2225 * sim-core.c: Ditto.
2229 * Make-common.in: Change clean targets to use :: so that other
2230 Makefiles can have their own clean targets.
2231 * sim-load.c (xprintf eprintf): Use ANSI_PROTOTYPES instead of
2232 __STDC__ to control use of stdarg vs. varargs syntax. Some
2233 systems can't use __STDC__, but require stdarg.
2237 * sim-options.c (standard_options): Add --endian.
2238 (standard_option_handler): Likewise.
2240 * nrun.c: #include <signal.h>.
2241 (main, cntrl_c): Wrap calls to sim_resume in a SIGINT
2242 handler that calls sim_stop ().
2246 * run.c (main, cntrl_c): Wrap calls to sim_resume in a SIGINT
2247 handler that calls sim_stop (). Simulators may still be
2248 establishing their own handler.
2250 * sim-events.c (sim_events_poll): Rename from
2251 sim_events_at_large_int. Poll IO.
2253 * sim-io.c (sim_io_poll_quit): New function - pass on a polling
2256 * callback.c (os_poll_quit): New function poll for quit signal
2258 (default_callback): Include magic number.
2262 * aclocal.m4: Check for headers time.h, sys/time.h, sys/resource.h.
2263 Check for functions getrusage, time.
2264 * sim-basics.h (SIM_ELAPSED_TIME): New typedef.
2265 (sim_elapsed_time_get, sim_elapsed_time_since): Add prototypes.
2266 * sim-utils.c: #include time.h, sys/time.h, sys/resource.h if able.
2267 (sim_elapsed_time_get, sim_elapsed_time_since): New functions.
2269 * sim-utils.c (sim_copy_argv, sim_analyze_program): New functions.
2271 * sim-options.c, sim-options.h: New files.
2272 * sim-config.h (WITH_DEBUG): Provide default value of zero.
2273 * Make-common.in (nrun.o): Add rules for.
2276 * run.c (main): Check return value of sim_open.
2278 * Make-common.in (sim-options.o, sim-load.o, sim-trace.o): Add rules.
2279 (sim_main_headers): Add sim-trace.h.
2280 * run.c (exec_bfd, target_byte_order): Delete.
2281 (main): Pass -E <endian> to sim_open. Delete code to load sections,
2282 call sim_load instead. Check return code of sim_create_inferior.
2283 * sim-base.h (CURRENT_STATE): Define.
2284 (sim_state_base): Make typedef. New members options, prog_argv,
2285 prog_bfd, text_{section,start,end}, start_addr, simcache_size,
2286 mem_size, memory [+ corresponding access macros].
2287 (sim_cpu_base): New typedef.
2288 * sim-trace.h: New file.
2289 * sim-trace.c: New file.
2290 * sim-basics.h: #include it.
2291 * sim-load.c: New file.
2295 * Make-common.in (INSTALL): Set to @INSTALL@.
2296 (INSTALL_XFORM, INSTALL_XFORM1): Remove.
2297 (install-common): Depend upon installdirs. Use
2298 $(program_transform_name) directly, rather than using
2300 (installdirs): New target.
2301 * Makefile.in (INSTALL): Set to @INSTALL@.
2302 (INSTALL_XFORM, INSTALL_XFORM1): Remove.
2303 (install-man): Depend upon installdirs. Use
2304 $(program_transform_name) directly, rather than using
2306 (installdirs): New target.
2310 * sim-assert.h (SIM_ASSERT, ASSERT): Allow these macros to
2315 * sim-basics.h: Only bring in config.h and tconfig.h if
2320 * sim-config.h (WITH_TARGET_WORD_MSB): New Macro. Define the bit
2321 numbering convention of the target.
2322 * sim-config.c (print_sim_config): Print WITH_TARGET_WORD_BITSIZE
2323 and WITH_TARGET_WORD_MSB.
2324 (sim_config): When possible, check for consistency with bitsize
2327 * sim-bits.h: Allow MSB to be other than zero.
2328 * sim-bits.c: Ditto.
2329 * sim-n-bits.h: Ditto.
2331 * sim-bits.h (MSMASK*): New macros - converce to LSMASK*.
2332 * sim-n-bits.h (MSMASKEDn): Ditto.
2336 * Makefile.in (INSTALL): Change install.sh to install-sh.
2340 * sim-base.h (sim_state_base): Move `magic' to end of struct.
2344 * run.c (main): Check that a program to run was specified.
2348 * aclocal.m4 (AC_TYPE_SIGNAL): Add check.
2350 * configure: Regenerated to track ../common/aclocal.m4 changes.
2355 * sim-endian.h: Move host {LITTLE,BIG}_ENDIAN support from here,
2356 * sim-config.h: To here.
2358 * Make-common.in (SIM_EXTRA_DEPS): New config var.
2359 (sim_main_headers): Define.
2360 (sim-*.o): Depend on $(SIM_EXTRA_DEPS).
2362 (BUILT_SRC_FROM_COMMON): Move here from ../d30v/Makefile.in.
2365 (sim-utils.o): Add rule for.
2366 * sim-utils.o: New file.
2367 * sim-basics.h: #include sim-base.h.
2368 (zalloc): Make argument unsigned long.
2369 * sim-base.h: New file.
2370 * sim-inline.h (SIM_IO support): Delete.
2371 * sim-io.h: Delete inline support.
2372 * sim-io.c: Likewise. sim-state.h renamed to sim-main.h.
2373 * sim-config.c: sim-state.h renamed to sim-main.h.
2374 * sim-core.c: Likewise.
2375 * sim-events.c: Likewise.
2377 * run.c (main): Pass SIM_OPEN_STANDALONE to sim_open.
2379 * aclocal.m4: Check for stdlib.h, string.h, strings.h, unistd.h.
2380 (sim-debug): Allow arguments. Define WITH_DEBUG in addition to
2382 * configure: Regenerated to track ../common/aclocal.m4 changes.
2386 * configure: Regenerated to track ../common/aclocal.m4 changes.
2390 * sim-config.h (WITH_ALIGNMENT, WITH_FLOATING_POINT,
2391 WITH_XOR_ENDIAN, WITH_SMP, WITH_RESERVED_BITS): Assume that these
2392 are defined by the configure.
2394 * aclocal.m4 (sim-stdio): Add option stdio from ../ppc configure.
2396 * aclocal.m4 (floating-point, xor-endian, alignment, smp,
2397 reserved-bits): Always define.
2399 * sim-config.h, sim-config.c (sim_config): New function - and new
2400 file - co-ordinate the setting/checking of the common simulator
2401 configuration options.
2403 * Make-common.in (sim-config.o): Add rule.
2407 * callback.c (os_{,e}vprintf_filtered): Change stdarg type to
2408 va_list from void *, since va_list might not be a pointer type.
2412 * sim-n-endian.h (offset_N): Correct assertion - word and sub word
2414 (offset_N): Correct computation of LE offset.
2416 * sim-io.c (sim_io_error): Include a new line when reporting
2419 * sim-assert.h (SIM_FILTER_PATH): Out by one when locating last
2424 * run.c: Include alloca-conf.h.
2426 * callback.c (os_evprintf_filtered): Fix typo.
2430 * run.c (string.h, strings.h, stdlib.h): Include.
2432 * sim-events.c (sim_events_tick): Recent cleanup failed to return
2433 0 when nothing pending.
2435 * run.c (sim_size, sim_trace): Plicate GCC - these two functions
2436 will soon be going away.
2437 (getopt): Plicate GCC.
2439 * sim-endian.c (sim-io.h): Plicate GCC.
2440 * sim-bits.c (sim-io.h): Ditto.
2441 * sim-n-bits.h (ROTn): Ditto.
2443 * sim-io.c (sim_io_error): Correct check for NULL.
2445 * sim-assert.h (SIM_FILTER_PATH): Separate out the code filtering
2447 * sim-events.c: Use SIM_FILTER_PATH to filter out the filename
2452 * aclocal.m4 (SIM_AC_OPTION_*: Move so that they are outside of
2453 SIM_AC_COMMON - SIM_AC_COMMON was gobling arguments.
2457 * sim-alu.h: Include sim-xcat.h.
2461 * Make-common.in (sim-bits.c, sim-core.c, sim-endian.c,
2462 sim-events.c, sim-inline.c, sim-io.c): Define rules for building
2465 * sim-events.c (sim_events_at_large_int): New function. Just
2466 schedules an event every large-int ticks.
2467 (sim_events_init): Call.
2468 (sim_events_tick, sim_events_process): Move async handing to
2469 sim_events_process. Move timer decrement so that it occures after
2470 events have been processed.
2472 * sim-basics.h (struct _engine): Remove declaration.
2474 * sim-events.h, sim-events.c: Rename type to sim_events. Prefix
2475 everything with same. Rename global struct to SIM_DESC.
2476 * sim-core.h, sim-core.c, sim-n-core.c: Ditto for sim_core.
2477 * sim-io.h, sim-io.c: Ditto.
2479 * sim-assert.h: New file. Optional assertion checking macros.
2480 * sim-io.c (sim_io_error): Make just this function tolerant to
2483 * sim-xcat.h: New file. Define concatenate macros.
2484 * sim-basics.h (XCONCAT*): Move to sim-xcat.h.
2485 * sim-n-core.h, sim-n-bits.h, sim-n-endian.h: Explicitly include
2491 * sim-bits.h (LSMASK): New macro. Create mask of LS bits.
2495 * sim-inline.h: Add definitions for sim-types.
2496 (ALL_BY_MODULE): New macro, encapsulate full inlining by the
2501 * sim-events.h: Remove defunct reference to callback struct.
2505 * configure: Re-generate.
2509 * Make-common.in (CSEARCH): Do not include the gdb directory in
2514 * Make-common.in (SIM_ENDIAN, SIM_HOSTENDIAN, SIM_INLINE,
2515 SIM_WARNING): Drop, requiring the simulator specific Makefile.in
2516 to explicitly incorporate these.
2518 * aclocal.m4 (--enable-sim-alignment); New option. Strongly
2519 specify the alignment restrictions of the target architecture -
2520 without this option all alignment restrictions are accomodated.
2521 (--enable-sim-assert): New option. Conditionally compile in
2522 assertion statements.
2523 (--enable-sim-float): New option. Strongly specify the target's
2524 floating point support.
2525 (--enable-sim-hardware): New option. Specify the hardware devices
2526 included in the simulation.
2527 (--enable-sim-packages): New option. Specify the hardware
2528 packages included in the simulation.
2529 (--enable-sim-regparm): New option. Specify that parameters be
2530 passed in registers instead of on the stack.
2531 (--enable-sim-reserved-bits): New option. Specify that reserved
2532 bits within an instruction are are correctly set.
2533 (--enable-sim-smp): New option. Specify the level of SMP support
2534 to be included in the simulator.
2535 (--enable-sim-stdcall): New option. Specify an alternative
2536 function call convention.
2537 (--enable-sim-xor-endian): New option. Configure xor-endian
2538 support used by some targets to implement bi-endian support.
2542 * aclocal.m4 (--enable-sim-hostendian): New option. Allow the
2543 host endianness to be overridden.
2544 (--enable-sim-endian): Allow the target platform's byte order
2546 (--enable-sim-inline): Control the inlining of common components.
2547 (--enable-sim-bswap): For compatibility, also define WITH_BSWAP.
2548 (--enable-sim-warnings): Enable additional GCC compiler checks.
2549 * Make-common.in (SIM_ENDIAN, SIM_HOSTENDIAN, SIM_INLINE,
2552 * sim-n-core.h, sim-n-bits.h, sim-n-endian.h: Rename from
2553 sim-*-n.h so that the names are uniq on dos machines
2554 * sim-core.c, sim-bits.c, sim-endian.c: Update.
2558 * run.c: #include "libiberty.h".
2559 (main): New locals sd,no_args,sim_argv.
2560 Run buildargv on -a option. Pass argv to sim_open, argv[0]
2561 is program name. Update call to sim_set_callbacks.
2562 Record result of sim_open, pass to other sim_foo routines.
2566 * callback.c (os_printf_filtered): Do not call exit(1) or print a
2571 * callback.c: Add os_flush_stdout and vprintf_filtered callbacks.
2572 Route stdout through buffered IO.
2574 * callback.c: Add os_flush_stderr, os_write_stderr,
2575 os_evprintf_filtered functions to route error output through
2578 * sim-io.h, sim-io.c (sim_io_flush_stderr, sim_io_flush_stdout):
2579 Correct return type - should be void.
2583 * sim-basics.h: Clean up. Many macro's moved to sim-inline.h.
2585 * sim-config.h: Ditto. For some options - eg WITH_DEVICES - do
2586 not provide a default value as undefined indicates disable code.
2590 * sim-core.h, sim-core-n.h, sim-core.c: Borrow code from ppc
2592 * sim-events.h, sim-events.c: Ditto.
2593 * sim-io.h, sim-io.c: Ditto.
2597 * sim-alu.h (ALU_SUB_CA, ALU*_SUB_CA): New alu operation.
2599 * sim-bits.h, sim-bits-n.h, sim-bits.c (LSMASKED*): New macro's
2600 extract the tail or least signifiant bits from an integer of the
2603 * sim-bits.h, sim-bits.c: Clean up conditionally compiled #if
2604 WITH_TARGET_BITSIZE so that the compilation will fail when an
2605 unsupported bitsize value is defined.
2607 (INSERTED*): Convert to functions.
2608 (EXTRACTED*): Ditto.
2610 (SIGN_EXTEND, SEXT): Change to more terse name.
2614 * sim-inline.h: Allow explicit control over which .c files will be
2615 included by their header.
2617 * sim-inline.h: Allow explicit control over which .c files use the
2618 alternative - REGPARM - parameter passing mechanism.
2620 * sim-inline.h, sim-inline.c: Don't attempt to include any of
2621 icache.c, idecode.c, semantics.c or support.c. Those names are
2622 not generally applicable.
2626 * sim-bits.c, sim-bits-n.h (new): Split sim-bits.c into two parts
2627 in a fashion similar to sim-endian-n.
2629 * sim-endian.h: (H_word, L_word, AL_*, VL_*): Extend to include
2630 both value and address macro's.
2634 * sim-alu.h (ALU16_BEGIN, ALU16_SET, ...): Fill in.
2636 * sim-endian.h (L_word, H_word): Replace MS2W_4, LS2W_4 with more
2637 generic L_word, H_word macro's.
2641 * sim-basics.h: Borrow code from ppc directory.
2642 * sim-bits.c: Ditto.
2643 * sim-bits.h: Ditto.
2644 * sim-config.h: Ditto.
2645 * sim-endian-n.h: Ditto.
2646 * sim-endian.c: Ditto.
2647 * sim-endian.h: Ditto.
2648 * sim-inline.c: Ditto.
2649 * sim-inline.h: Ditto.
2650 * sim-types.h: Ditto.
2654 * sim-alu.h (ALU_SET16, ALU_SET32, ALU_SET64, etc): Make available
2655 all the ALU size alternatives and then auto-configure a default.
2657 * sim-alu.h: Copy ppc/idecode_expression.h.
2661 * bits.h, bits.c (SIGN_EXTEND32, SIGN_EXTEND64): New functions,
2662 sign extend a bit within a value.
2664 * sim-endian.h, sim-endian-n.h (offset_N): New functions - return
2665 a pointer into the middle of a host word.
2666 * sim-endian.h (MS2W_4, LS2W_4): Use this function.
2670 * callback.c: If HAVE_CONFIG_H is defined, include config.h from
2671 autoconf. If HAVE_UNISTD_H is defined, include unistd.h to get
2672 appropriate definitions of read, write, etc. Add prototype for
2677 * Makefile.in (libcommon.a): Delete.
2678 (callback.o,targ-map.o): Delete, moved to Make-common.in.
2679 (gentmap,targ-vals.h,targ-map.c): Likewise.
2680 (run-autoconf): Delete.
2681 * aclocal.m4 (SIM_AC_OUTPUT): Redo creation of Makefile.
2682 (common makefile fragment): Moved back into ...
2683 * Make-common.in: Resurrect.
2684 * configure.in (AC_LINK_FILES): Delete, unnecessary now.
2685 * configure: Regenerated.
2689 * aclocal.m4 (SIM_AC_COMMON): Move COMMON_MAKEFILE_FRAG from here.
2690 (SIM_AC_OUTPUT): To here.
2694 * aclocal.m4 (COMMON_MAKEFILE_FRAG): Quote a couple of $'s in
2695 comments and single quotes. Fixes a problem found on hpux.
2699 * aclocal.m4: Remove Make-common.in from dependencies.
2700 * (distclean): Remove targ-vals.def.
2702 * aclocal.m4 (SIM_AC_COMMON): Move contents of Make-common.in
2703 into here. Makes insertion into makefiles easier. Also, change
2704 the way that callback.o, gentmap, targ-vals.h, targ-map.c,
2705 targ-map.o, and run are built. They are now built in the
2706 individual simulator directories, taking sources from ../common as
2707 necessary. This replaces the merging of libcommon.a into
2708 linsim.a, which was problematic for the WinGDB build process.
2709 * run.c: Include config.h from . instead of ../common.
2710 * Make-common.in: Remove. It's no longer necessary.
2714 * Make-common.in (ALL_CLAGS): Put CFLAGS at the end.
2715 (.c.o): Put $(ALL_CFLAGS) before the file being compiled.
2719 * run.c (main): Set target_byte_order before call to sim_open.
2723 * callback.c: #include <stdlib.h>
2724 (os_error): New function.
2725 (default_callback): Add os_error.
2729 * Make-common.in (Makefile): Set CONFIG_HEADERS="".
2730 * aclocal.m4: Mark the fact that --enable-sim-bswap isn't host
2732 (SIM_AC_OUTPUT): Don't build Makefile if CONFIG_FILES="".
2736 * run.c: #include ../common/config.h, tconfig.h.
2737 (myname): New static global.
2738 (main): Recognize new options -a, -c. Also recognize -h if h8/300.
2739 Only process -c ifdef SIM_HAVE_SIMCACHE.
2740 Only process -p/-s ifdef SIM_HAVE_PROFILE.
2741 Parse program name from argv[0] and use in error messages.
2742 Pass sim_args to sim_open. Pass prog_args to sim_create_inferior.
2743 Add support for incomplete h8/300 termination indicators.
2744 (usage): Make more verbose.
2745 * aclocal.m4,config.in,tconfig.in,configure.in,configure: New files.
2746 * Makefile.in,Make-common.in,callback.c: New files.
2747 * nltvals.def,gentmap.c,gentvals.sh: New files.
2751 * run.c: Include stdarg.h if __STDC__.
2755 * run.c (main): Don't print out anything if the signal
2756 number is zero (ie no signal).
2760 * run.c (main): Print out if the program raised a signal.
2764 * run.c (exec_bfd): Rename from sim_bfd, to use the gdb name.
2769 * run.c (main): Explicitly cast malloc() parameter.
2773 * run.c (sim_bfd): New global to hold the bfd pointer for the
2775 (main): Initialize sim_bfd.
2779 * run.c (main): Use new bfd_big_endian macro.
2783 * run.c (main): Removed SH specific comments, so source is
2784 generic. Also updated to only load relevant sections. Moved
2785 sim_open() to after callback attach (to match GDB).
2787 * run.1: Removed SH specific comments.
2791 * run.c (main): Always return sigrc at end.
2795 * run.c (main): Print error diagnostic and exit if bfd_openr() or
2796 bfd_check_format() fails.
2800 * run.c, run.1: From sh directory.