/*
 * Copyright (c) 2012 The Native Client Authors. All rights reserved.
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#include <stdint.h>
#include "native_client/src/trusted/service_runtime/sel_util.h"

uint32_t NaClGetStackPtr(void) {
  uint32_t sp;

  asm("mov %0, %%sp" : "=r" (sp));

  return sp;
}

/*
 * Copyright (c) 2012 The Native Client Authors. All rights reserved.
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#include <stdint.h>
#include "native_client/src/trusted/service_runtime/sel_util.h"

uint32_t NaClGetStackPtr(void) {
  uint32_t sp;

  asm("mov %0, sp" : "=r" (sp));

  return sp;
}

Make sel build with clang's built-in assembler.
arm: Make sel build with clang's built-in assembler.

clang's integrated assembler only supports UAL, where sp is spelled
sp and not %sp. Fixes the following error when building with clang's
integrated assembler enabled:

../../native_client/src/trusted/service_runtime/linux/arm/sel_segments.c:13:7: error: unexpected token in operand
  asm("mov %0, %%sp" : "=r" (sp));
      ^
<inline asm>:1:10: note: instantiated into assembly here
        mov r0, %sp
                ^
1 error generated.

BUG=chromium:124610

Review URL: https://codereview.chromium.org/1485143002
