1 : /*
2 : * Copyright 2010 The Native Client Authors. All rights reserved.
3 : * Use of this source code is governed by a BSD-style license that can
4 : * be found in the LICENSE file.
5 : */
6 :
7 : /* @file
8 : *
9 : * Implementation of effector subclass used only for service runtime's
10 : * gio_shm object for mapping/unmapping shared memory in *trusted*
11 : * address space.
12 : */
13 :
14 : #include "native_client/src/trusted/desc/nacl_desc_effector_trusted_mem.h"
15 : #include "native_client/src/shared/platform/nacl_log.h"
16 :
17 : static struct NaClDescEffectorVtbl const NaClDescEffectorTrustedMemVtbl;
18 :
19 7 : int NaClDescEffectorTrustedMemCtor(struct NaClDescEffectorTrustedMem *self) {
20 7 : self->base.vtbl = &NaClDescEffectorTrustedMemVtbl;
21 7 : return 1;
22 : }
23 :
24 6 : static void NaClDescEffTrustedMemDtor(struct NaClDescEffector *vself) {
25 6 : vself->vtbl = (struct NaClDescEffectorVtbl const *) NULL;
26 : return;
27 : }
28 :
29 : static int NaClDescEffTrustedMemUnmapMemory(struct NaClDescEffector *vself,
30 : uintptr_t sysaddr,
31 40 : size_t nbytes) {
32 : UNREFERENCED_PARAMETER(vself);
33 : UNREFERENCED_PARAMETER(sysaddr);
34 : UNREFERENCED_PARAMETER(nbytes);
35 40 : NaClLog(4, "TrustedMem effector's UnmapMemory called, nothing to do\n");
36 40 : return 0;
37 : }
38 :
39 : static uintptr_t NaClDescEffTrustedMemMapAnonMem(
40 : struct NaClDescEffector *vself,
41 : uintptr_t sysaddr,
42 : size_t nbytes,
43 0 : int prot) {
44 : UNREFERENCED_PARAMETER(vself);
45 : UNREFERENCED_PARAMETER(sysaddr);
46 : UNREFERENCED_PARAMETER(nbytes);
47 : UNREFERENCED_PARAMETER(prot);
48 0 : NaClLog(LOG_FATAL, "TrustedMem effector's MapAnonMem called\n");
49 0 : return 0;
50 : }
51 :
52 : static struct NaClDescEffectorVtbl const NaClDescEffectorTrustedMemVtbl = {
53 : NaClDescEffTrustedMemDtor,
54 : NaClDescEffTrustedMemUnmapMemory,
55 : NaClDescEffTrustedMemMapAnonMem,
56 : };
|