blob: d46cdb71369a70ad627e702442e4096ccb0e3ee8 [file] [log] [blame]
TrustworthySystemsbad8ea52014-07-22 14:11:27 +10001/*
Gerwin Klein600fe152021-02-10 19:19:17 +11002 * Copyright 2017, Data61, CSIRO (ABN 41 687 119 230)
TrustworthySystemsbad8ea52014-07-22 14:11:27 +10003 *
Gerwin Klein600fe152021-02-10 19:19:17 +11004 * SPDX-License-Identifier: BSD-2-Clause
TrustworthySystemsbad8ea52014-07-22 14:11:27 +10005 */
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 Lyonsa9fbd452015-10-13 15:15:22 +110015static int cspace_alloc(void *data, seL4_CPtr *res)
16{
TrustworthySystemsbad8ea52014-07-22 14:11:27 +100017 return -1;
18}
19
Anna Lyonsa9fbd452015-10-13 15:15:22 +110020static void cspace_make_path(void *data, seL4_CPtr slot, cspacepath_t *res)
21{
TrustworthySystemsbad8ea52014-07-22 14:11:27 +100022}
23
Anna Lyonsa9fbd452015-10-13 15:15:22 +110024static void cspace_free(void *data, seL4_CPtr slot)
25{
TrustworthySystemsbad8ea52014-07-22 14:11:27 +100026}
27
28static int utspace_alloc(void *data, const cspacepath_t *dest, seL4_Word type,
Adrian Danisfd1e94e2016-03-01 17:02:28 +110029 seL4_Word size_bits, seL4_Word *res)
Anna Lyonsa9fbd452015-10-13 15:15:22 +110030{
TrustworthySystemsbad8ea52014-07-22 14:11:27 +100031 return -1;
32}
33
Kent McLeodb4cc5482017-02-20 15:59:46 +110034static 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 Danis0f440ea2016-02-19 13:52:55 +110040static 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
TrustworthySystemsbad8ea52014-07-22 14:11:27 +100046static void utspace_free(void *data, seL4_Word type, seL4_Word size_bits,
Adrian Danisfd1e94e2016-03-01 17:02:28 +110047 seL4_Word target)
Anna Lyonsa9fbd452015-10-13 15:15:22 +110048{
TrustworthySystemsbad8ea52014-07-22 14:11:27 +100049}
50
James Yea1adf1d2019-01-18 11:15:11 +110051static 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 Lyonsa9fbd452015-10-13 15:15:22 +110056void vka_init_nullvka(vka_t *vka)
57{
TrustworthySystemsbad8ea52014-07-22 14:11:27 +100058 assert(vka != NULL);
James Yea1adf1d2019-01-18 11:15:11 +110059 *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 };
TrustworthySystemsbad8ea52014-07-22 14:11:27 +100070}