Skip to content
Permalink
Browse files

native_posix: introduce a native_posix_64 board configuration

Because the only difference between native_posix and native_posix_64
should be 32-bit vs 64-bit compilation, the NATIVE_POSIX menu option
is turned into NATIVE_POSIX_32 and the NATIVE_POSIX_64 is added, with
both selecting NATIVE_POSIX. This way nothing changes for the existing
native_posix target, allowing it to share almost everything with the
64-bit version.

Both flavors are made available for CI tests to pick them. This assumes
both 32-bit and 64-bit build environments are available.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
  • Loading branch information...
Nicolas Pitre authored and andrewboie committed May 17, 2019
1 parent 1f783d9 commit 8c5c5a94524d351c97b3dd5d6a15e330ae2d2340
@@ -1,5 +1,11 @@
# SPDX-License-Identifier: Apache-2.0

config BOARD_NATIVE_POSIX
bool
select HAS_DTS
select NATIVE_POSIX_TIMER
select NATIVE_POSIX_CONSOLE

if BOARD_NATIVE_POSIX

comment "Native POSIX options"
@@ -1,13 +1,24 @@
# SPDX-License-Identifier: Apache-2.0

config BOARD_NATIVE_POSIX
bool "Native POSIX"
config BOARD_NATIVE_POSIX_32BIT
bool "Native POSIX for 32-bit host"
depends on SOC_POSIX
select HAS_DTS
select NATIVE_POSIX_TIMER
select NATIVE_POSIX_CONSOLE
select BOARD_NATIVE_POSIX
help
Will produce a console Linux process which can be executed natively.
Will produce a console Linux process which can be executed natively
as a 32-bit executable.
It provides some minimal needed models:
An interrupt controller, timer (system tick), and redirects kernel prints to
stdout.

config BOARD_NATIVE_POSIX_64BIT
bool "Native POSIX for 64-bit host"
depends on SOC_POSIX
select BOARD_NATIVE_POSIX
select 64BIT
help
Will produce a console Linux process which can be executed natively
as a 64-bit executable.
It provides some minimal needed models:
An interrupt controller, timer (system tick), and redirects kernel prints to
stdout.
@@ -12,6 +12,7 @@ config OUTPUT_PRINT_MEMORY_USAGE
default n

config BOARD
default "native_posix_64" if BOARD_NATIVE_POSIX_64BIT
default "native_posix"

if NETWORKING
@@ -1,5 +1,5 @@
identifier: native_posix
name: Native POSIX port
name: Native 32-bit POSIX port
type: native
arch: posix
toolchain:
@@ -0,0 +1,8 @@
/*
* Copyright (c) 2019 BayLibre SAS
*
* SPDX-License-Identifier: Apache-2.0
*/

/dts-v1/;
#include "native_posix.dts"
@@ -0,0 +1,12 @@
identifier: native_posix_64
name: Native 64-bit POSIX port
type: native
arch: posix
toolchain:
- zephyr
- llvm
supported:
- netif:eth
- usb_device
testing:
default: true
@@ -0,0 +1,7 @@
# SPDX-License-Identifier: Apache-2.0

CONFIG_ARCH_POSIX=y
CONFIG_SOC_POSIX=y
CONFIG_BOARD_NATIVE_POSIX_64BIT=y
CONFIG_CONSOLE=y
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=1000000
@@ -2,6 +2,6 @@

CONFIG_ARCH_POSIX=y
CONFIG_SOC_POSIX=y
CONFIG_BOARD_NATIVE_POSIX=y
CONFIG_BOARD_NATIVE_POSIX_32BIT=y
CONFIG_CONSOLE=y
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=1000000

0 comments on commit 8c5c5a9

Please sign in to comment.
You can’t perform that action at this time.