Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions examples/fdpicxip/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# ##############################################################################
# apps/examples/fdpicxip/CMakeLists.txt
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. The ASF licenses this
# file to you under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
#
# ##############################################################################

if(CONFIG_EXAMPLES_FDPICXIP)
nuttx_add_application(NAME fdpicxip SRCS fdpicxip_main.c)
endif()
39 changes: 39 additions & 0 deletions examples/fdpicxip/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#

config EXAMPLES_FDPICXIP
tristate "FDPIC modules executed in place from xipfs demo"
depends on FS_XIPFS && FDPIC && LIBC_EXECFUNCS
default n
---help---
Write FDPIC modules into xipfs at run time, the way a download
would, then run them. Their text is executed directly out of
flash and shared between concurrent instances, while each
instance gets its own data.

Subcommands:

qsort one self-contained module, two instances
solib a shared library across two instances
cxx the same in C++, checking global constructors ran
jmprel a module whose imports are all in DT_JMPREL

With no subcommand, qsort runs.

The modules are embedded in the image as C headers. Their
sources are in modules/, which rebuilds the headers on an
explicit 'make regen': linking one needs arm-uclinuxfdpiceabi
binutils, which this build does not.

This demonstrates; it does not assert. For the assertions see
the fdpic and reject sections of CONFIG_TESTING_FS_XIPFS.

if EXAMPLES_FDPICXIP

config EXAMPLES_FDPICXIP_MOUNTPT
string "xipfs mountpoint"
default "/mnt/xipfs"

endif # EXAMPLES_FDPICXIP
25 changes: 25 additions & 0 deletions examples/fdpicxip/Make.defs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
############################################################################
# apps/examples/fdpicxip/Make.defs
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################

ifneq ($(CONFIG_EXAMPLES_FDPICXIP),)
CONFIGURED_APPS += $(APPDIR)/examples/fdpicxip
endif
37 changes: 37 additions & 0 deletions examples/fdpicxip/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
############################################################################
# apps/examples/fdpicxip/Makefile
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################

include $(APPDIR)/Make.defs

# FDPIC modules executed in place from xipfs. The modules are embedded as
# headers, built from the sources in modules/ by an explicit 'make regen'
# there: linking one needs arm-uclinuxfdpiceabi binutils, which this build
# does not.

MAINSRC = fdpicxip_main.c

PROGNAME = fdpicxip
PRIORITY = SCHED_PRIORITY_DEFAULT
STACKSIZE = $(CONFIG_DEFAULT_TASK_STACKSIZE)
MODULE = $(CONFIG_EXAMPLES_FDPICXIP)

include $(APPDIR)/Application.mk
Loading
Loading