#include "basics.h"
#include "registers.h"
#include "device_tree.h"
-#include "memory_map.h"
-#include "core.h"
+#include "corefile.h"
#include "vm.h"
#include "events.h"
#include "interrupts.h"
#include "psim.h"
#include "icache.h"
+#include "itable.h"
+#include "mon.h"
+#include "model.h"
+#ifndef CONST_ATTRIBUTE
+#define CONST_ATTRIBUTE __attribute__((__const__))
+#endif
/* typedef struct _cpu cpu;
(psim *system,
core *memory,
event_queue *events,
+ cpu_mon *monitor,
int cpu_nr);
+INLINE_CPU void cpu_init
+(cpu *processor);
/* Find our way home */
INLINE_CPU psim *cpu_system
-(cpu *processor);
+(cpu *processor) CONST_ATTRIBUTE;
+
+INLINE_CPU cpu_mon *cpu_monitor
+(cpu *processor) CONST_ATTRIBUTE;
INLINE_CPU int cpu_nr
-(cpu *processor);
+(cpu *processor) CONST_ATTRIBUTE;
INLINE_CPU event_queue *cpu_event_queue
(cpu *processor);
int signal);
-#if WITH_IDECODE_CACHE
-/* gain acces to the processors instruction cracking cache
+#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 */
- Only useful (and visable) if we're cracking the cache */
-INLINE_CPU idecode_cache *cpu_icache
+INLINE_CPU idecode_cache *cpu_icache_entry
+(cpu *processor,
+ unsigned_word cia);
+
+INLINE_CPU void cpu_flush_icache
(cpu *processor);
#endif
-/* reveal the processor address maps
+/* reveal the processors VM:
At first sight it may seem better to, instead of exposing the cpu's
inner vm maps, to have the cpu its self provide memory manipulation
the vm protection (eg store breakpoint instruction in the
instruction map). */
-INLINE_CPU vm_instruction_map *cpu_instruction_map
-(cpu *processor);
-
INLINE_CPU vm_data_map *cpu_data_map
(cpu *processor);
-INLINE_CPU core *cpu_core
+INLINE_CPU vm_instruction_map *cpu_instruction_map
(cpu *processor);
(cpu *processor);
-INLINE_CPU void cpu_increment_number_of_insns
-(cpu *processor);
-
-INLINE_CPU long cpu_get_number_of_insns
-(cpu *processor);
-
INLINE_CPU void cpu_print_info
(cpu *processor,
int verbose);
+
/* Registers:
This model exploits the PowerPC's requirement for a synchronization
below to when ever a synchronization point is reached */
INLINE_CPU registers *cpu_registers
-(cpu *processor);
+(cpu *processor) CONST_ATTRIBUTE;
INLINE_CPU void cpu_synchronize_context
(cpu *processor);
+INLINE_CPU model_data *cpu_model
+(cpu *processor) CONST_ATTRIBUTE;
+
#define IS_PROBLEM_STATE(PROCESSOR) \
-(CURRENT_ENVIRONMENT == VIRTUAL_ENVIRONMENT \
- || (cpu_registers(PROCESSOR)->msr & msr_problem_state))
+(CURRENT_ENVIRONMENT == OPERATING_ENVIRONMENT \
+ ? (cpu_registers(PROCESSOR)->msr & msr_problem_state) \
+ : 1)
#define IS_64BIT_MODE(PROCESSOR) \
-((CURRENT_ENVIRONMENT == VIRTUAL_ENVIRONMENT && WITH_64BIT_TARGET) \
- || (cpu_registers(PROCESSOR)->msr & msr_64bit_mode))
+(WITH_TARGET_WORD_BITSIZE == 64 \
+ ? (CURRENT_ENVIRONMENT == OPERATING_ENVIRONMENT \
+ ? (cpu_registers(PROCESSOR)->msr & msr_64bit_mode) \
+ : 1) \
+ : 0)
#define IS_FP_AVAILABLE(PROCESSOR) \
-(CURRENT_ENVIRONMENT == VIRTUAL_ENVIRONMENT \
- || (cpu_registers(PROCESSOR)->msr & msr_floating_point_available))
+(CURRENT_ENVIRONMENT == OPERATING_ENVIRONMENT \
+ ? (cpu_registers(PROCESSOR)->msr & msr_floating_point_available) \
+ : 1)
#endif