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 <vspace/mapping.h> 14 15int vspace_get_map_obj(seL4_Word failed_bits, vspace_map_obj_t *obj) { 16 if (unlikely(obj == NULL)) { 17 return EINVAL; 18 } 19 20 switch (failed_bits) { 21 case SEL4_MAPPING_LOOKUP_NO_PT: 22 obj->size_bits = seL4_PageTableBits; 23 obj->type = seL4_ARM_PageTableObject; 24 obj->map_fn = seL4_ARM_PageTable_Map; 25 return 0; 26 default: 27 return EINVAL; 28 } 29} 30