Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / native_client / src / minsfi / trusted / syscall / heaplim.c
1 /*
2  * Copyright (c) 2014 The Native Client Authors. All rights reserved.
3  * Use of this source code is governed by a BSD-style license that can be
4  * found in the LICENSE file.
5  */
6
7 #include "native_client/src/include/minsfi_syscalls.h"
8
9 int32_t __minsfi_syscall_heaplim(sfiptr_t dest_lower_limit,
10                                  sfiptr_t dest_upper_limit) {
11   const MinsfiSandbox *sb = MinsfiGetActiveSandbox();
12
13   sfiptr_t val_lower_limit = sb->mem_layout.heap.offset;
14   sfiptr_t val_upper_limit = val_lower_limit + sb->mem_layout.heap.length;
15
16   MinsfiCopyToSandbox(dest_lower_limit, &val_lower_limit,
17                       sizeof(val_lower_limit), sb);
18   MinsfiCopyToSandbox(dest_upper_limit, &val_upper_limit,
19                       sizeof(val_upper_limit), sb);
20
21   return 0;
22 }