OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can | 3 * Use of this source code is governed by a BSD-style license that can be |
4 * be found in the LICENSE file. | 4 * found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include "native_client/src/trusted/service_runtime/sel_util.h" | 8 #include "native_client/src/trusted/service_runtime/sel_util.h" |
9 | 9 |
10 uint32_t NaClGetStackPtr(void) { | 10 uint32_t NaClGetStackPtr(void) { |
11 uint32_t sp; | 11 uint32_t sp; |
12 | 12 |
13 asm("move %0, $sp" : "=r" (sp)); | 13 asm("move %0, $sp" : "=r" (sp)); |
14 | 14 |
15 return sp; | 15 return sp; |
16 } | 16 } |
17 | 17 |
18 uint32_t NaClGetGlobalPtr(void) { | |
19 uint32_t gp; | |
20 | |
21 asm("move %0, $gp" : "=r" (gp)); | |
22 | |
23 return gp; | |
24 } | |
25 | |
OLD | NEW |