From dcb2b2077fa8342399b7bea17e78af47d67eeb38 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 10 Jul 2015 08:35:36 -0600 Subject: [PATCH] Update protected build logic for all platforms that supported the protected build. This is necessary due to changes in the definition of the userspace interface --- .../mikroe-stm32f4/kernel/stm32_userspace.c | 20 +++++------------ configs/mikroe-stm32f4/scripts/user-space.ld | 17 +------------- configs/open1788/kernel/lpc17_userspace.c | 20 +++++------------ configs/open1788/scripts/user-space.ld | 17 +------------- configs/sam3u-ek/kernel/sam_userspace.c | 20 +++++------------ configs/sam3u-ek/scripts/user-space.ld | 16 -------------- .../stm3240g-eval/kernel/stm32_userspace.c | 20 +++++------------ configs/stm3240g-eval/scripts/user-space.ld | 15 ------------- .../stm32f4discovery/kernel/stm32_userspace.c | 22 +++++-------------- .../stm32f4discovery/scripts/user-space.ld | 17 +------------- 10 files changed, 29 insertions(+), 155 deletions(-) diff --git a/configs/mikroe-stm32f4/kernel/stm32_userspace.c b/configs/mikroe-stm32f4/kernel/stm32_userspace.c index 18f19757fc..c7c89018ad 100644 --- a/configs/mikroe-stm32f4/kernel/stm32_userspace.c +++ b/configs/mikroe-stm32f4/kernel/stm32_userspace.c @@ -1,7 +1,7 @@ /**************************************************************************** * configs/mikroe-stm32f4/kernel/stm32_userspace.c * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -101,6 +101,10 @@ const struct userspace_s userspace __attribute__ ((section (".userspace"))) = .us_bssstart = (uintptr_t)&_sbss, .us_bssend = (uintptr_t)&_ebss, + /* Memory manager heap structure */ + + .us_heap = &g_mmheap, + /* Task/thread startup routines */ .task_startup = task_startup, @@ -114,20 +118,6 @@ const struct userspace_s userspace __attribute__ ((section (".userspace"))) = .signal_handler = up_signal_handler, #endif - /* Memory manager entry points (declared in include/nuttx/mm/mm.h) */ - - .mm_initialize = umm_initialize, - .mm_addregion = umm_addregion, - .mm_trysemaphore = umm_trysemaphore, - .mm_givesemaphore = umm_givesemaphore, - - /* Memory manager entry points (declared in include/stdlib.h) */ - - .mm_malloc = malloc, - .mm_realloc = realloc, - .mm_zalloc = zalloc, - .mm_free = free, - /* User-space work queue support (declared in include/nuttx/wqueue.h) */ #ifdef CONFIG_LIB_USRWORK diff --git a/configs/mikroe-stm32f4/scripts/user-space.ld b/configs/mikroe-stm32f4/scripts/user-space.ld index 917046d272..ffb106d8d0 100644 --- a/configs/mikroe-stm32f4/scripts/user-space.ld +++ b/configs/mikroe-stm32f4/scripts/user-space.ld @@ -1,7 +1,7 @@ /**************************************************************************** * configs/mikroe-stm32f4/scripts/user-space.ld * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,21 +37,6 @@ * this script. */ -/* Make sure that the critical memory management functions are in user-space. - * the user heap memory manager will reside in user-space but be usable both - * by kernel- and user-space code - */ - -EXTERN(umm_initialize) -EXTERN(umm_addregion) -EXTERN(umm_trysemaphore) -EXTERN(umm_givesemaphore) - -EXTERN(malloc) -EXTERN(realloc) -EXTERN(zalloc) -EXTERN(free) - OUTPUT_ARCH(arm) SECTIONS { diff --git a/configs/open1788/kernel/lpc17_userspace.c b/configs/open1788/kernel/lpc17_userspace.c index 9000779901..37e0dfd3d6 100644 --- a/configs/open1788/kernel/lpc17_userspace.c +++ b/configs/open1788/kernel/lpc17_userspace.c @@ -1,7 +1,7 @@ /**************************************************************************** * configs/open1788/kernel/lpc17_userspace.c * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -101,6 +101,10 @@ const struct userspace_s userspace __attribute__ ((section (".userspace"))) = .us_bssstart = (uintptr_t)&_sbss, .us_bssend = (uintptr_t)&_ebss, + /* Memory manager heap structure */ + + .us_heap = &g_mmheap, + /* Task/thread startup routines */ .task_startup = task_startup, @@ -114,20 +118,6 @@ const struct userspace_s userspace __attribute__ ((section (".userspace"))) = .signal_handler = up_signal_handler, #endif - /* Memory manager entry points (declared in include/nuttx/mm/mm.h) */ - - .mm_initialize = umm_initialize, - .mm_addregion = umm_addregion, - .mm_trysemaphore = umm_trysemaphore, - .mm_givesemaphore = umm_givesemaphore, - - /* Memory manager entry points (declared in include/stdlib.h) */ - - .mm_malloc = malloc, - .mm_realloc = realloc, - .mm_zalloc = zalloc, - .mm_free = free, - /* User-space work queue support (declared in include/nuttx/wqueue.h) */ #ifdef CONFIG_LIB_USRWORK diff --git a/configs/open1788/scripts/user-space.ld b/configs/open1788/scripts/user-space.ld index e2979e4a3b..734e492d57 100644 --- a/configs/open1788/scripts/user-space.ld +++ b/configs/open1788/scripts/user-space.ld @@ -1,7 +1,7 @@ /**************************************************************************** * configs/open1788/scripts/user-space.ld * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,21 +37,6 @@ * this script. */ -/* Make sure that the critical memory management functions are in user-space. - * the user heap memory manager will reside in user-space but be usable both - * by kernel- and user-space code - */ - -EXTERN(umm_initialize) -EXTERN(umm_addregion) -EXTERN(umm_trysemaphore) -EXTERN(umm_givesemaphore) - -EXTERN(malloc) -EXTERN(realloc) -EXTERN(zalloc) -EXTERN(free) - OUTPUT_ARCH(arm) SECTIONS { diff --git a/configs/sam3u-ek/kernel/sam_userspace.c b/configs/sam3u-ek/kernel/sam_userspace.c index fed33dd392..9ca96b1230 100644 --- a/configs/sam3u-ek/kernel/sam_userspace.c +++ b/configs/sam3u-ek/kernel/sam_userspace.c @@ -1,7 +1,7 @@ /**************************************************************************** * configs/sam3u-ek/kernel/sam_userspace.c * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -101,6 +101,10 @@ const struct userspace_s userspace __attribute__ ((section (".userspace"))) = .us_bssstart = (uintptr_t)&_sbss, .us_bssend = (uintptr_t)&_ebss, + /* Memory manager heap structure */ + + .us_heap = &g_mmheap, + /* Task/thread startup routines */ .task_startup = task_startup, @@ -114,20 +118,6 @@ const struct userspace_s userspace __attribute__ ((section (".userspace"))) = .signal_handler = up_signal_handler, #endif - /* Memory manager entry points (declared in include/nuttx/mm/mm.h) */ - - .mm_initialize = umm_initialize, - .mm_addregion = umm_addregion, - .mm_trysemaphore = umm_trysemaphore, - .mm_givesemaphore = umm_givesemaphore, - - /* Memory manager entry points (declared in include/stdlib.h) */ - - .mm_malloc = malloc, - .mm_realloc = realloc, - .mm_zalloc = zalloc, - .mm_free = free, - /* User-space work queue support (declared in include/nuttx/wqueue.h) */ #ifdef CONFIG_LIB_USRWORK diff --git a/configs/sam3u-ek/scripts/user-space.ld b/configs/sam3u-ek/scripts/user-space.ld index 53b402257a..fed1c24ead 100644 --- a/configs/sam3u-ek/scripts/user-space.ld +++ b/configs/sam3u-ek/scripts/user-space.ld @@ -37,23 +37,7 @@ * this script. */ -/* Make sure that the critical memory management functions are in user-space. - * the user heap memory manager will reside in user-space but be usable both - * by kernel- and user-space code - */ - -EXTERN(umm_initialize) -EXTERN(umm_addregion) -EXTERN(umm_trysemaphore) -EXTERN(umm_givesemaphore) - -EXTERN(malloc) -EXTERN(realloc) -EXTERN(zalloc) -EXTERN(free) - OUTPUT_ARCH(arm) - SECTIONS { .userspace : { diff --git a/configs/stm3240g-eval/kernel/stm32_userspace.c b/configs/stm3240g-eval/kernel/stm32_userspace.c index f27209584a..faca2fb74e 100644 --- a/configs/stm3240g-eval/kernel/stm32_userspace.c +++ b/configs/stm3240g-eval/kernel/stm32_userspace.c @@ -1,7 +1,7 @@ /**************************************************************************** * configs/stm3240g-eval/kernel/stm32_userspace.c * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -101,6 +101,10 @@ const struct userspace_s userspace __attribute__ ((section (".userspace"))) = .us_bssstart = (uintptr_t)&_sbss, .us_bssend = (uintptr_t)&_ebss, + /* Memory manager heap structure */ + + .us_heap = &g_mmheap, + /* Task/thread startup routines */ .task_startup = task_startup, @@ -114,20 +118,6 @@ const struct userspace_s userspace __attribute__ ((section (".userspace"))) = .signal_handler = up_signal_handler, #endif - /* Memory manager entry points (declared in include/nuttx/mm/mm.h) */ - - .mm_initialize = umm_initialize, - .mm_addregion = umm_addregion, - .mm_trysemaphore = umm_trysemaphore, - .mm_givesemaphore = umm_givesemaphore, - - /* Memory manager entry points (declared in include/stdlib.h) */ - - .mm_malloc = malloc, - .mm_realloc = realloc, - .mm_zalloc = zalloc, - .mm_free = free, - /* User-space work queue support (declared in include/nuttx/wqueue.h) */ #ifdef CONFIG_LIB_USRWORK diff --git a/configs/stm3240g-eval/scripts/user-space.ld b/configs/stm3240g-eval/scripts/user-space.ld index 30dc328355..b602a071c6 100644 --- a/configs/stm3240g-eval/scripts/user-space.ld +++ b/configs/stm3240g-eval/scripts/user-space.ld @@ -37,21 +37,6 @@ * this script. */ -/* Make sure that the critical memory management functions are in user-space. - * the user heap memory manager will reside in user-space but be usable both - * by kernel- and user-space code - */ - -EXTERN(umm_initialize) -EXTERN(umm_addregion) -EXTERN(umm_trysemaphore) -EXTERN(umm_givesemaphore) - -EXTERN(malloc) -EXTERN(realloc) -EXTERN(zalloc) -EXTERN(free) - OUTPUT_ARCH(arm) SECTIONS { diff --git a/configs/stm32f4discovery/kernel/stm32_userspace.c b/configs/stm32f4discovery/kernel/stm32_userspace.c index 3b6108eede..1dac94c6fc 100644 --- a/configs/stm32f4discovery/kernel/stm32_userspace.c +++ b/configs/stm32f4discovery/kernel/stm32_userspace.c @@ -1,7 +1,7 @@ /**************************************************************************** * configs/stm32f4discovery/kernel/stm32_userspace.c * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -73,7 +73,7 @@ * - The declaration extern uint32_t _sdata; makes C happy. C will believe * that the value _sdata is the address of a uint32_t variable _data (it is * not!). - * - We can recoved the linker value then by simply taking the address of + * - We can recover the linker value then by simply taking the address of * of _data. like: uint32_t *pdata = &_sdata; */ @@ -102,6 +102,10 @@ const struct userspace_s userspace __attribute__ ((section (".userspace"))) = .us_bssstart = (uintptr_t)&_sbss, .us_bssend = (uintptr_t)&_ebss, + /* Memory manager heap structure */ + + .us_heap = &g_mmheap, + /* Task/thread startup routines */ .task_startup = task_startup, @@ -115,20 +119,6 @@ const struct userspace_s userspace __attribute__ ((section (".userspace"))) = .signal_handler = up_signal_handler, #endif - /* Memory manager entry points (declared in include/nuttx/mm/mm.h) */ - - .mm_initialize = umm_initialize, - .mm_addregion = umm_addregion, - .mm_trysemaphore = umm_trysemaphore, - .mm_givesemaphore = umm_givesemaphore, - - /* Memory manager entry points (declared in include/stdlib.h) */ - - .mm_malloc = malloc, - .mm_realloc = realloc, - .mm_zalloc = zalloc, - .mm_free = free, - /* User-space work queue support (declared in include/nuttx/wqueue.h) */ #ifdef CONFIG_LIB_USRWORK diff --git a/configs/stm32f4discovery/scripts/user-space.ld b/configs/stm32f4discovery/scripts/user-space.ld index 56d30a05f1..4002d8bbcc 100644 --- a/configs/stm32f4discovery/scripts/user-space.ld +++ b/configs/stm32f4discovery/scripts/user-space.ld @@ -1,7 +1,7 @@ /**************************************************************************** * configs/stm32f4discovery/scripts/user-space.ld * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,21 +37,6 @@ * this script. */ -/* Make sure that the critical memory management functions are in user-space. - * the user heap memory manager will reside in user-space but be usable both - * by kernel- and user-space code - */ - -EXTERN(umm_initialize) -EXTERN(umm_addregion) -EXTERN(umm_trysemaphore) -EXTERN(umm_givesemaphore) - -EXTERN(malloc) -EXTERN(realloc) -EXTERN(zalloc) -EXTERN(free) - OUTPUT_ARCH(arm) SECTIONS {