xcoff slurp_armap bounds checking
[deliverable/binutils-gdb.git] / sim / ppc / cpu.h
index efd49a529102a1ba2a547a85a358b11d5182a980..bafb5e1791a1f23fccf61d4e6f6afcc06f2d7ab0 100644 (file)
@@ -1,10 +1,10 @@
 /*  This file is part of the program psim.
 
-    Copyright (C) 1994-1995, Andrew Cagney <cagney@highland.com.au>
+    Copyright (C) 1994-1997, Andrew Cagney <cagney@highland.com.au>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
+    the Free Software Foundation; either version 3 of the License, or
     (at your option) any later version.
 
     This program is distributed in the hope that it will be useful,
@@ -13,8 +13,7 @@
     GNU General Public License for more details.
  
     You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+    along with this program; if not, see <http://www.gnu.org/licenses/>.
  
     */
 
 #ifndef _CPU_H_
 #define _CPU_H_
 
-#ifndef INLINE_CPU
-#define INLINE_CPU
-#endif
-
 #include "basics.h"
 #include "registers.h"
-#include "device_tree.h"
+#include "device.h"
 #include "corefile.h"
 #include "vm.h"
 #include "events.h"
 #include "interrupts.h"
 #include "psim.h"
-#include "icache.h"
+#include "idecode.h"
 #include "itable.h"
+#include "os_emul.h"
 #include "mon.h"
 #include "model.h"
+#include "libiberty.h"
 
 #ifndef CONST_ATTRIBUTE
 #define CONST_ATTRIBUTE __attribute__((__const__))
 
 /* Create a cpu object */
 
-INLINE_CPU cpu *cpu_create
+INLINE_CPU\
+(cpu *) cpu_create
 (psim *system,
  core *memory,
- event_queue *events,
  cpu_mon *monitor,
+ os_emul *cpu_emulation,
  int cpu_nr);
 
-INLINE_CPU void cpu_init
+INLINE_CPU\
+(void) cpu_init
 (cpu *processor);
 
 /* Find our way home */
 
-INLINE_CPU psim *cpu_system
-(cpu *processor) CONST_ATTRIBUTE;
-
-INLINE_CPU cpu_mon *cpu_monitor
+INLINE_CPU\
+(psim *) cpu_system
 (cpu *processor) CONST_ATTRIBUTE;
 
-INLINE_CPU int cpu_nr
+INLINE_CPU\
+(cpu_mon *) cpu_monitor
 (cpu *processor) CONST_ATTRIBUTE;
 
-INLINE_CPU event_queue *cpu_event_queue
+INLINE_CPU\
+(os_emul *) cpu_os_emulation
 (cpu *processor);
 
-
-/* The processors local concept of time */
-
-INLINE_CPU signed64 cpu_get_time_base
-(cpu *processor);
-
-INLINE_CPU void cpu_set_time_base
-(cpu *processor,
- signed64 time_base);
-
-INLINE_CPU signed32 cpu_get_decrementer
-(cpu *processor);
-
-INLINE_CPU void cpu_set_decrementer
-(cpu *processor,
- signed32 decrementer);
+INLINE_CPU\
+(int) cpu_nr
+(cpu *processor) CONST_ATTRIBUTE;
 
 
-/* manipulate the program counter
+/* manipulate the processors program counter and execution state.
 
    The program counter is not included in the register file.  Instead
    it is extracted and then later restored (set, reset, halt).  This
@@ -101,34 +87,68 @@ INLINE_CPU void cpu_set_decrementer
    minimize the need to load/store the cpu's PC value.  (Especially in
    the case of a single processor) */
 
-INLINE_CPU void cpu_set_program_counter
+INLINE_CPU\
+(void) cpu_set_program_counter
 (cpu *processor,
  unsigned_word new_program_counter);
 
-INLINE_CPU unsigned_word cpu_get_program_counter
+INLINE_CPU\
+(unsigned_word) cpu_get_program_counter
 (cpu *processor);
 
-INLINE_CPU void cpu_restart
+INLINE_CPU\
+(void) cpu_restart
 (cpu *processor,
  unsigned_word nia);
 
-INLINE_CPU void cpu_halt
+INLINE_CPU\
+(void) cpu_halt
 (cpu *processor,
  unsigned_word nia,
  stop_reason reason,
  int signal);
 
+EXTERN_CPU\
+(void) cpu_error
+(cpu *processor,
+ unsigned_word cia,
+ const char *fmt,
+ ...) __attribute__ ((format (printf, 3, 4)));
+
+
+/* The processors local concept of time */
+
+INLINE_CPU\
+(signed64) cpu_get_time_base
+(cpu *processor);
+
+INLINE_CPU\
+(void) cpu_set_time_base
+(cpu *processor,
+ signed64 time_base);
+
+INLINE_CPU\
+(signed32) cpu_get_decrementer
+(cpu *processor);
+
+INLINE_CPU\
+(void) cpu_set_decrementer
+(cpu *processor,
+ signed32 decrementer);
+
 
 #if WITH_IDECODE_CACHE_SIZE
 /* Return the cache entry that matches the given CIA.  No guarentee
    that the cache entry actually contains the instruction for that
    address */
 
-INLINE_CPU idecode_cache *cpu_icache_entry
+INLINE_CPU\
+(idecode_cache) *cpu_icache_entry
 (cpu *processor,
  unsigned_word cia);
 
-INLINE_CPU void cpu_flush_icache
+INLINE_CPU\
+(void) cpu_flush_icache
 (cpu *processor);
 #endif
 
@@ -144,29 +164,44 @@ INLINE_CPU void cpu_flush_icache
    the vm protection (eg store breakpoint instruction in the
    instruction map). */
 
-INLINE_CPU vm_data_map *cpu_data_map
+INLINE_CPU\
+(vm_data_map *) cpu_data_map
+(cpu *processor);
+
+INLINE_CPU\
+(vm_instruction_map *) cpu_instruction_map
 (cpu *processor);
 
-INLINE_CPU vm_instruction_map *cpu_instruction_map
+INLINE_CPU\
+(void) cpu_page_tlb_invalidate_entry
+(cpu *processor,
+ unsigned_word ea);
+
+INLINE_CPU\
+(void) cpu_page_tlb_invalidate_all
+(cpu *processor);
+
+
+/* reveal the processors interrupt state */
+
+INLINE_CPU\
+(interrupts *) cpu_interrupts
 (cpu *processor);
 
 
 /* grant access to the reservation information */
+
 typedef struct _memory_reservation {
   int valid;
   unsigned_word addr;
   unsigned_word data;
 } memory_reservation;
 
-INLINE_CPU memory_reservation *cpu_reservation
+INLINE_CPU\
+(memory_reservation *) cpu_reservation
 (cpu *processor);
 
 
-INLINE_CPU void cpu_print_info
-(cpu *processor,
- int verbose);
-
-
 /* Registers:
 
    This model exploits the PowerPC's requirement for a synchronization
@@ -174,14 +209,14 @@ INLINE_CPU void cpu_print_info
    register.  All context sync points must call the sync function
    below to when ever a synchronization point is reached */
 
-INLINE_CPU registers *cpu_registers
+INLINE_CPU\
+(registers *) cpu_registers
 (cpu *processor) CONST_ATTRIBUTE;
 
-INLINE_CPU void cpu_synchronize_context
-(cpu *processor);
-
-INLINE_CPU model_data *cpu_model
-(cpu *processor) CONST_ATTRIBUTE;
+INLINE_CPU\
+(void) cpu_synchronize_context
+(cpu *processor,
+ unsigned_word cia);
 
 #define IS_PROBLEM_STATE(PROCESSOR) \
 (CURRENT_ENVIRONMENT == OPERATING_ENVIRONMENT \
@@ -200,4 +235,20 @@ INLINE_CPU model_data *cpu_model
  ? (cpu_registers(PROCESSOR)->msr & msr_floating_point_available) \
  : 1)
 
+
+
+INLINE_CPU\
+(void) cpu_print_info
+(cpu *processor,
+ int verbose);
+
+INLINE_CPU\
+(model_data *) cpu_model
+(cpu *processor) CONST_ATTRIBUTE;
+
+
+#if (CPU_INLINE & INCLUDE_MODULE)
+# include "cpu.c"
+#endif
+
 #endif
This page took 0.027023 seconds and 4 git commands to generate.