1/* 2 * Copyright 2017, Data61 3 * Commonwealth Scientific and Industrial Research Organisation (CSIRO) 4 * ABN 41 687 119 230. 5 * 6 * This software may be distributed and modified according to the terms of 7 * the BSD 2-Clause license. Note that NO WARRANTY is provided. 8 * See "LICENSE_BSD2.txt" for details. 9 * 10 * @TAG(DATA61_BSD) 11 */ 12#pragma once 13 14#include <stdint.h> 15#include <sel4/sel4.h> 16#include <sel4/arch/pfIPC.h> 17#include <sel4/arch/exIPC.h> 18 19#define EXCEPT_IPC_SYS_MR_IP EXCEPT_IPC_SYS_MR_RIP 20 21static inline void 22sel4utils_set_instruction_pointer(seL4_UserContext *regs, seL4_Word value) 23{ 24 regs->rip = value; 25} 26 27static inline seL4_Word 28sel4utils_get_instruction_pointer(seL4_UserContext regs) 29{ 30 return regs.rip; 31} 32 33static inline seL4_Word 34sel4utils_get_sp(seL4_UserContext regs) 35{ 36 return regs.rsp; 37} 38 39static inline void 40sel4utils_set_stack_pointer(seL4_UserContext *regs, seL4_Word value) 41{ 42 regs->rsp = value; 43} 44 45