1/* 2 * Copyright 2018, 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 13#include <rumprun/init_data.h> 14 15#include <sel4platsupport/timer.h> 16#include <platsupport/plat/timer.h> 17#include <sel4/helpers.h> 18#include <stdio.h> 19#include <sel4platsupport/device.h> 20 21/* The below 2 functions are implementations of the libsel4simple arch specific interface. 22 See libsel4simple/arch_include/x86/simple/arch/simple.h for further documentation */ 23static seL4_Error 24get_IOPort_cap(void *data, uint16_t start_port, uint16_t end_port, seL4_Word root, seL4_Word dest, seL4_Word depth) 25{ 26 init_data_t *init = (init_data_t *) data; 27 28 return seL4_CNode_Copy(root, dest, depth, simple_get_cnode(&env.simple), init->io_port, CONFIG_WORD_SIZE, seL4_AllRights); 29} 30 31void 32arch_init_simple(simple_t *simple) 33{ 34 simple->arch_simple.IOPort_cap = get_IOPort_cap; 35 simple->arch_simple.data = (void *) simple->data; 36} 37