arc: libgloss: Prepare for porting to ARCv3
There are 3 families of Synopsys DeisgnWare ARC processors: ARCompact/ARCv1 (32-bit), ARCv2 (32-bit) and ARCv3 (32-bit and 64-bit targets). Upstream Newlib supports only ARCv1/2. This commit prepares ARCv1/2 libgloss port to be reused by ARCv3 port (except crt* files). Note that __ARC64__ macro stands for all ARCv3 targets. Signed-off-by: Yuriy Kolerov <ykolerov@synopsys.com>
This commit is contained in:
parent
03f4e346f4
commit
b99f27c25f
|
@ -15,6 +15,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/times.h>
|
||||
|
@ -44,6 +45,19 @@ _getpid (void)
|
|||
return __MYPID;
|
||||
}
|
||||
|
||||
/* We do not have 64-bit compatible hostlink fstat. */
|
||||
#if defined (__ARC64__)
|
||||
int
|
||||
_fstat (int fd, struct stat *st)
|
||||
{
|
||||
memset (st, 0, sizeof (*st));
|
||||
st->st_mode = S_IFCHR;
|
||||
st->st_blksize = 1024;
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* hostlink backend has only fstat(), so use fstat() in stat(). */
|
||||
int
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include "hl_gw.h"
|
||||
|
||||
#define HL_VERSION 1
|
||||
|
@ -134,7 +135,15 @@ _hl_send (volatile __uncached void *p)
|
|||
|
||||
_hl_pkt_init (pkt_hdr, _hl_payload_used (p));
|
||||
|
||||
#if defined (__ARC64__)
|
||||
/*
|
||||
* Here we pass only low 4 bytes of the packet address (pkt_hdr).
|
||||
* The high part of the address is obtained from __HOSTLINK__ address.
|
||||
*/
|
||||
hdr->buf_addr = (uintptr_t) pkt_hdr & 0xFFFFFFFF;
|
||||
#else
|
||||
hdr->buf_addr = (uint32_t) pkt_hdr;
|
||||
#endif
|
||||
hdr->payload_size = _hl_payload_size ();
|
||||
hdr->host2target_addr = HL_NOADDRESS;
|
||||
hdr->version = HL_VERSION;
|
||||
|
|
|
@ -19,7 +19,12 @@
|
|||
#define _HL_TOOLCHAIN_H
|
||||
|
||||
#ifndef __uncached
|
||||
#if defined (__ARC64__)
|
||||
/* TODO: Uncached attribute is not implemented for ARCv3 yet. */
|
||||
#define __uncached
|
||||
#else
|
||||
#define __uncached __attribute__((uncached))
|
||||
#endif
|
||||
#endif /* __uncached */
|
||||
|
||||
#ifndef __aligned
|
||||
|
@ -43,7 +48,12 @@
|
|||
#endif /* __noreturn */
|
||||
|
||||
#ifndef __longcall
|
||||
#if defined (__ARC64__)
|
||||
/* TODO: Long call attribute is not implemented for ARCv3 yet. */
|
||||
#define __longcall
|
||||
#else
|
||||
#define __longcall __attribute__((long_call))
|
||||
#endif
|
||||
#endif /* __longcall */
|
||||
|
||||
#define HL_MAX_DCACHE_LINE 256
|
||||
|
|
|
@ -100,7 +100,12 @@ _open (const char * pathname, int flags, int mode)
|
|||
}
|
||||
|
||||
/* Should be provided by crt0.S. */
|
||||
#if defined (__ARC64__)
|
||||
/* TODO: long_call is not implemented yet in GCC. Fix this when implemented. */
|
||||
extern void __attribute__((noreturn)) _exit_halt (int ret);
|
||||
#else
|
||||
extern void __attribute__((noreturn, long_call)) _exit_halt (int ret);
|
||||
#endif
|
||||
|
||||
void
|
||||
__attribute__((noreturn))
|
||||
|
|
Loading…
Reference in New Issue