TrustworthySystems | bad8ea5 | 2014-07-22 14:11:27 +1000 | [diff] [blame] | 1 | /* |
Gerwin Klein | 600fe15 | 2021-02-10 19:19:17 +1100 | [diff] [blame] | 2 | * Copyright 2017, Data61, CSIRO (ABN 41 687 119 230) |
TrustworthySystems | bad8ea5 | 2014-07-22 14:11:27 +1000 | [diff] [blame] | 3 | * |
Gerwin Klein | 600fe15 | 2021-02-10 19:19:17 +1100 | [diff] [blame] | 4 | * SPDX-License-Identifier: BSD-2-Clause |
TrustworthySystems | bad8ea5 | 2014-07-22 14:11:27 +1000 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #include <assert.h> |
| 8 | #include <sel4/sel4.h> |
| 9 | #include <stdint.h> |
| 10 | #include <stdlib.h> |
| 11 | #include <vka/cspacepath_t.h> |
| 12 | #include <vka/null-vka.h> |
| 13 | #include <vka/vka.h> |
| 14 | |
Anna Lyons | a9fbd45 | 2015-10-13 15:15:22 +1100 | [diff] [blame] | 15 | static int cspace_alloc(void *data, seL4_CPtr *res) |
| 16 | { |
TrustworthySystems | bad8ea5 | 2014-07-22 14:11:27 +1000 | [diff] [blame] | 17 | return -1; |
| 18 | } |
| 19 | |
Anna Lyons | a9fbd45 | 2015-10-13 15:15:22 +1100 | [diff] [blame] | 20 | static void cspace_make_path(void *data, seL4_CPtr slot, cspacepath_t *res) |
| 21 | { |
TrustworthySystems | bad8ea5 | 2014-07-22 14:11:27 +1000 | [diff] [blame] | 22 | } |
| 23 | |
Anna Lyons | a9fbd45 | 2015-10-13 15:15:22 +1100 | [diff] [blame] | 24 | static void cspace_free(void *data, seL4_CPtr slot) |
| 25 | { |
TrustworthySystems | bad8ea5 | 2014-07-22 14:11:27 +1000 | [diff] [blame] | 26 | } |
| 27 | |
| 28 | static int utspace_alloc(void *data, const cspacepath_t *dest, seL4_Word type, |
Adrian Danis | fd1e94e | 2016-03-01 17:02:28 +1100 | [diff] [blame] | 29 | seL4_Word size_bits, seL4_Word *res) |
Anna Lyons | a9fbd45 | 2015-10-13 15:15:22 +1100 | [diff] [blame] | 30 | { |
TrustworthySystems | bad8ea5 | 2014-07-22 14:11:27 +1000 | [diff] [blame] | 31 | return -1; |
| 32 | } |
| 33 | |
Kent McLeod | b4cc548 | 2017-02-20 15:59:46 +1100 | [diff] [blame] | 34 | static int utspace_alloc_maybe_device(void *data, const cspacepath_t *dest, seL4_Word type, |
| 35 | seL4_Word size_bits, bool can_use_dev, seL4_Word *res) |
| 36 | { |
| 37 | return -1; |
| 38 | } |
| 39 | |
Adrian Danis | 0f440ea | 2016-02-19 13:52:55 +1100 | [diff] [blame] | 40 | static int utspace_alloc_at(void *data, const cspacepath_t *dest, seL4_Word type, |
| 41 | seL4_Word size_bits, uintptr_t paddr, seL4_Word *res) |
| 42 | { |
| 43 | return -1; |
| 44 | } |
| 45 | |
TrustworthySystems | bad8ea5 | 2014-07-22 14:11:27 +1000 | [diff] [blame] | 46 | static void utspace_free(void *data, seL4_Word type, seL4_Word size_bits, |
Adrian Danis | fd1e94e | 2016-03-01 17:02:28 +1100 | [diff] [blame] | 47 | seL4_Word target) |
Anna Lyons | a9fbd45 | 2015-10-13 15:15:22 +1100 | [diff] [blame] | 48 | { |
TrustworthySystems | bad8ea5 | 2014-07-22 14:11:27 +1000 | [diff] [blame] | 49 | } |
| 50 | |
James Ye | a1adf1d | 2019-01-18 11:15:11 +1100 | [diff] [blame] | 51 | static uintptr_t utspace_paddr(void *data, seL4_Word target, seL4_Word type, seL4_Word size_bits) |
| 52 | { |
| 53 | return VKA_NO_PADDR; |
| 54 | } |
| 55 | |
Anna Lyons | a9fbd45 | 2015-10-13 15:15:22 +1100 | [diff] [blame] | 56 | void vka_init_nullvka(vka_t *vka) |
| 57 | { |
TrustworthySystems | bad8ea5 | 2014-07-22 14:11:27 +1000 | [diff] [blame] | 58 | assert(vka != NULL); |
James Ye | a1adf1d | 2019-01-18 11:15:11 +1100 | [diff] [blame] | 59 | *vka = (vka_t) { |
| 60 | .data = NULL, /* not required */ |
| 61 | .cspace_alloc = cspace_alloc, |
| 62 | .cspace_make_path = cspace_make_path, |
| 63 | .utspace_alloc = utspace_alloc, |
| 64 | .utspace_alloc_maybe_device = utspace_alloc_maybe_device, |
| 65 | .utspace_alloc_at = utspace_alloc_at, |
| 66 | .cspace_free = cspace_free, |
| 67 | .utspace_free = utspace_free, |
| 68 | .utspace_paddr = utspace_paddr |
| 69 | }; |
TrustworthySystems | bad8ea5 | 2014-07-22 14:11:27 +1000 | [diff] [blame] | 70 | } |