Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: aarch64 sizeof



"Jonathan A. Kollasch" <jakllsch%kollasch.net@localhost> wrote:
>On Sun, Aug 26, 2018 at 06:52:53PM +0100, Robert Swindells wrote:
>> 
>> What is the size of long on aarch64 ?
>> 
>
>When using the gcc-based toolchain here with the following program:
>
>"""
>#include <stdio.h>
>int main (int argc, char **argv) { printf("%zu %zu\n", sizeof(long),
>sizeof(int)); return 0; }
>"""
>
># ./test             
>8 4
>
>So, it's what I'd expect.

Thanks, I don't have a bootable system yet to test it myself.

>> I tried setting up the headers to be able to build kernels with SLJIT
>> but am getting an error that looks like there is a mismatch between
>> whatever type is being used for sljit_sw and a pointer.
>
>What did that involve doing?

Index: include/sljit_machdep.h
===================================================================
RCS file: /cvsroot/src/sys/arch/evbarm/include/sljit_machdep.h,v
retrieving revision 1.1
diff -u -r1.1 sljit_machdep.h
--- include/sljit_machdep.h	23 Jul 2014 18:19:43 -0000	1.1
+++ include/sljit_machdep.h	26 Aug 2018 18:16:16 -0000
@@ -1,3 +1,7 @@
 /*	$NetBSD: sljit_machdep.h,v 1.1 2014/07/23 18:19:43 alnsn Exp $	*/
 
+#ifdef __arch64__
+#include <aarch64/sljit_machdep.h>
+#else
 #include <arm/sljit_machdep.h>
+#endif
Index: conf/files.generic64
===================================================================
RCS file: /cvsroot/src/sys/arch/evbarm/conf/files.generic64,v
retrieving revision 1.3
diff -u -r1.3 files.generic64
--- conf/files.generic64	16 Jun 2018 00:19:04 -0000	1.3
+++ conf/files.generic64	26 Aug 2018 18:16:16 -0000
@@ -15,3 +15,9 @@
 include "arch/arm/rockchip/files.rockchip"
 include "arch/arm/sunxi/files.sunxi"
 include "arch/arm/virt/files.virt"
+
+#
+# Stack-less Just-In-Time compiler
+#
+
+include	"external/bsd/sljit/conf/files.sljit"


Plus a guess at src/sys/arch/aarch64/include/sljit_machdep.h:

/*	$NetBSD: $	*/

/*-
 * Copyright (c) 2014 Alexander Nasonov.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#ifndef _AARCH64_SLJITARCH_H
#define _AARCH64_SLJITARCH_H

#include <sys/cdefs.h>

#ifdef _KERNEL
#include <machine/types.h>
#include <aarch64/cpufunc.h>
#else
#include <stddef.h>
#include <stdint.h>
#include <aarch64/sysarch.h>
#endif

#define SLJIT_CONFIG_ARM_64 1

#ifdef _KERNEL
#define SLJIT_CACHE_FLUSH(from, to) \
	cpu_icache_sync_range((vaddr_t)(from), (vsize_t)((to) - (from)))
#else
#define SLJIT_CACHE_FLUSH(from, to) \
	(void)aarch64_sync_icache((uintptr_t)(from), (size_t)((to) - (from)))
#endif

#endif


Home | Main Index | Thread Index | Old Index