Skip to content

Commit 55f464d

Browse files
Patatermeriac
authored andcommitted
Copy memory management code over from uVisor
Add the memory management code from uVisor to a shared location that is suitable for both supported and unsupported use. To do this, we copy all the RTX-specific files from the RTX folders in uVisor. Note that the page allocator code is so identical between uVisor supported and unsupported mode that we can copy the file as-is from uVisor for use on unsupported targets. This commit performs that copying, to a file called page_allocator.c_inc, which is included from unsupported_page_allocator.c only for targets where uVisor is not present.
1 parent 10d9c2f commit 55f464d

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

features/FEATURE_UVISOR/importer/Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ TARGET_PREFIX:=../
2828
TARGET_SUPPORTED:=$(TARGET_PREFIX)targets/TARGET_UVISOR_SUPPORTED
2929
TARGET_UNSUPPORTED:=$(TARGET_PREFIX)targets/TARGET_UVISOR_UNSUPPORTED
3030
TARGET_INC:=$(TARGET_PREFIX)includes/uvisor/api
31+
TARGET_LIB_SRC:=$(TARGET_PREFIX)source
32+
TARGET_LIB_INC:=$(TARGET_PREFIX)includes/uvisor-lib
3133

3234
# uVisor source directory - hidden from mbed via TARGET_IGNORE
3335
UVISOR_GIT_URL:=https://github.com/ARMmbed/uvisor
@@ -60,11 +62,18 @@ rsync:
6062
rm -rf $(TARGET_INC)
6163
mkdir -p $(TARGET_INC)
6264
rsync -a --delete $(UVISOR_API)/inc $(TARGET_INC)
65+
rsync -a --delete $(UVISOR_API)/rtx/inc/ $(TARGET_LIB_INC)/rtx
6366
#
6467
# Copying uVisor unsupported sources to unsupported target source...
6568
mkdir -p $(TARGET_UNSUPPORTED)
6669
cp $(UVISOR_API)/src/unsupported.c $(TARGET_UNSUPPORTED)/
6770
#
71+
# Copying uVisor shared sources to mbed source...
72+
rm -rf $(TARGET_LIB_SRC)
73+
mkdir -p $(TARGET_LIB_SRC)
74+
cp $(UVISOR_DIR)/core/system/src/page_allocator.c $(TARGET_LIB_SRC)/page_allocator.c_inc
75+
rsync -a --delete $(UVISOR_API)/rtx/src/ $(TARGET_LIB_SRC)/rtx
76+
#
6877
# Copying licenses
6978
cp $(UVISOR_DIR)/LICENSE* $(TARGET_SUPPORTED)
7079

features/FEATURE_UVISOR/includes/uvisor-lib/uvisor-lib.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,8 @@
3535

3636
/* The uVisor API main header file will use the above definitions. */
3737
#include "uvisor/api/inc/uvisor-lib.h"
38+
#include "uvisor-lib/rtx/process_malloc.h"
39+
#include "uvisor-lib/rtx/rtx_box_index.h"
40+
#include "uvisor-lib/rtx/secure_allocator.h"
3841

3942
#endif /* __UVISOR_LIB_UVISOR_LIB_H__ */

0 commit comments

Comments
 (0)