/*
 * 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 <errno.h>

#include "native_client/src/untrusted/irt/irt.h"
#include "native_client/src/untrusted/nacl/syscall_bindings_trampoline.h"

static int nacl_irt_tls_init(void *thread_ptr) {
  return -NACL_SYSCALL(tls_init)(thread_ptr);
}

static void *nacl_irt_tls_get(void) {
  return NACL_SYSCALL(tls_get)();
}

const struct nacl_irt_tls nacl_irt_tls = {
  nacl_irt_tls_init,
  nacl_irt_tls_get,
};

/*
 * 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 <errno.h>

#include "native_client/src/untrusted/irt/irt.h"
#include "native_client/src/untrusted/nacl/syscall_bindings_trampoline.h"

static int nacl_irt_tls_init(void *thread_ptr) {
  return -NACL_SYSCALL(tls_init)(thread_ptr);
}

const struct nacl_irt_tls nacl_irt_tls = {
  nacl_irt_tls_init,
  NACL_SYSCALL(tls_get),
};

Reduce the cost of getting the thread pointer by one jump on x86-64
TLS: Reduce the cost of getting the thread pointer by one jump on x86-64

BUG=none
TEST=run_hello_world_test_irt on x86-64
R=mcgrathr@chromium.org

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

git-svn-id: 721b910a23eff8a86f00c8fd261a7587cddf18f8@13045 fcba33aa-ac0c-11dd-b9e7-8d5594d729c2
