summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/kvx/sysdep.h
blob: 944fedead54cbcfb31b6e371362bf9fe0a02784d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
 * This file is subject to the terms and conditions of the LGPL V2.1
 * License.  See the file "COPYING" in the main directory of this archive
 * for more details.
 *
 * Copyright (C) 2018 Kalray Inc.
 */

#ifndef _LINUX_KVX_SYSDEP_H
#define _LINUX_KVX_SYSDEP_H 1

#include <common/sysdep.h>

#define SYS_ify(syscall_name)  (__NR_##syscall_name)

#ifdef	__ASSEMBLER__

# define _ENTRY(name)                    \
  .align 8;                              \
  .globl C_SYMBOL_NAME(name);            \
  .func  C_SYMBOL_NAME(name);            \
  .type  C_SYMBOL_NAME(name), @function; \
C_SYMBOL_NAME(name):		   	 \
	        cfi_startproc;

/* Define an entry point visible from C.  */
# ifdef PIC
# define ENTRY(name)                    \
  .pic					\
  _ENTRY(name)

# else
# define ENTRY(name) _ENTRY(name)
# endif

#endif

/* Local label name for asm code.  */
# ifndef L
#  define L(name) $L##name
# endif

#undef END
#define END(name) \
  cfi_endproc;        \
  .endfunc;           \
  .size C_SYMBOL_NAME(name), .-C_SYMBOL_NAME(name)

#endif //_LINUX_KVX_SYSDEP_H