1/* 2 * Copyright 2014, General Dynamics C4 Systems 3 * 4 * This software may be distributed and modified according to the terms of 5 * the GNU General Public License version 2. Note that NO WARRANTY is provided. 6 * See "LICENSE_GPLv2.txt" for details. 7 * 8 * @TAG(GD_GPL) 9 */ 10 11#include <types.h> 12#include <machine/registerset.h> 13#include <arch/machine.h> 14#include <plat/machine/hardware.h> 15 16word_t PURE 17getRestartPC(tcb_t *thread) 18{ 19 return getRegister(thread, FaultInstruction); 20} 21 22void 23setNextPC(tcb_t *thread, word_t v) 24{ 25 setRegister(thread, LR_svc, v); 26} 27 28BOOT_CODE int 29get_num_avail_p_regs(void) 30{ 31 return sizeof(avail_p_regs) / sizeof(p_region_t); 32} 33 34BOOT_CODE int 35get_num_dev_p_regs(void) 36{ 37 return sizeof(dev_p_regs) / sizeof(p_region_t); 38} 39 40BOOT_CODE p_region_t get_dev_p_reg(word_t i) 41{ 42 return dev_p_regs[i]; 43} 44 45BOOT_CODE p_region_t get_avail_p_reg(word_t i) 46{ 47 return avail_p_regs[i]; 48} 49 50BOOT_CODE void 51map_kernel_devices(void) 52{ 53 for (int i = 0; i < ARRAY_SIZE(kernel_devices); i++) { 54 map_kernel_frame(kernel_devices[i].paddr, 55 kernel_devices[i].pptr, 56 VMKernelOnly, 57 vm_attributes_new(kernel_devices[i].armExecuteNever, 58 false, false)); 59 } 60} 61 62