Lines Matching defs:processor
48 /* the system this processor is contained within */
85 cpu *processor = ZALLOC(cpu);
88 processor->physical = memory;
89 processor->virtual = vm_create(memory);
90 processor->instruction_map = vm_create_instruction_map(processor->virtual);
91 processor->data_map = vm_create_data_map(processor->virtual);
94 processor->model_ptr = model_create (processor);
97 processor->system = system;
98 processor->events = psim_event_queue(system);
99 processor->cpu_nr = cpu_nr;
100 processor->monitor = monitor;
101 processor->os_emulation = os_emulation;
103 return processor;
109 cpu_init(cpu *processor)
111 memset(&processor->regs, 0, sizeof(processor->regs));
115 model_init (processor->model_ptr);
123 cpu_system(cpu *processor)
125 return processor->system;
130 cpu_nr(cpu *processor)
132 return processor->cpu_nr;
137 cpu_monitor(cpu *processor)
139 return processor->monitor;
144 cpu_os_emulation(cpu *processor)
146 return processor->os_emulation;
151 cpu_model(cpu *processor)
153 return processor->model_ptr;
161 cpu_set_program_counter(cpu *processor,
164 processor->program_counter = new_program_counter;
169 cpu_get_program_counter(cpu *processor)
171 return processor->program_counter;
177 cpu_restart(cpu *processor,
180 ASSERT(processor != NULL);
181 cpu_set_program_counter(processor, nia);
182 psim_restart(processor->system, processor->cpu_nr);
187 cpu_halt(cpu *processor,
192 ASSERT(processor != NULL);
194 model_halt(processor->model_ptr);
195 cpu_set_program_counter(processor, nia);
196 psim_halt(processor->system, processor->cpu_nr, reason, signal);
201 cpu_error(cpu *processor,
218 if (processor != NULL) {
220 processor->cpu_nr + 1, (unsigned long)cia, message);
221 cpu_halt(processor, cia, was_signalled, -1);
233 cpu_get_time_base(cpu *processor)
235 return (event_queue_time(processor->events)
236 - processor->time_base_local_time);
241 cpu_set_time_base(cpu *processor,
244 processor->time_base_local_time = (event_queue_time(processor->events)
250 cpu_get_decrementer(cpu *processor)
252 return (processor->decrementer_local_time
253 - event_queue_time(processor->events));
260 cpu *processor = (cpu*)data;
261 processor->decrementer_event = NULL;
262 decrementer_interrupt(processor);
267 cpu_set_decrementer(cpu *processor,
270 int64_t old_decrementer = cpu_get_decrementer(processor);
271 event_queue_deschedule(processor->events, processor->decrementer_event);
272 processor->decrementer_event = NULL;
273 processor->decrementer_local_time = (event_queue_time(processor->events)
279 decrementer_interrupt(processor);
281 processor->decrementer_event = event_queue_schedule(processor->events,
284 processor);
292 cpu_icache_entry(cpu *processor,
295 return &processor->icache[cia / 4 % WITH_IDECODE_CACHE_SIZE];
301 cpu_flush_icache(cpu *processor)
306 processor->icache[i].address = MASK(0, 63);
315 cpu_instruction_map(cpu *processor)
317 return processor->instruction_map;
322 cpu_data_map(cpu *processor)
324 return processor->data_map;
329 cpu_page_tlb_invalidate_entry(cpu *processor,
332 vm_page_tlb_invalidate_entry(processor->virtual, ea);
337 cpu_page_tlb_invalidate_all(cpu *processor)
339 vm_page_tlb_invalidate_all(processor->virtual);
347 cpu_interrupts(cpu *processor)
349 return &processor->ints;
358 cpu_reservation(cpu *processor)
360 return &processor->reservation;
368 cpu_registers(cpu *processor)
370 return &processor->regs;
375 cpu_synchronize_context(cpu *processor,
380 cpu_flush_icache(processor);
384 vm_synchronize_context(processor->virtual,
385 processor->regs.spr,
386 processor->regs.sr,
387 processor->regs.msr,
388 processor, cia);
396 cpu_print_info(cpu *processor, int verbose)