diff --git a/configs/ea3131/src/ea3131_internal.h b/configs/ea3131/src/ea3131_internal.h index 504212c26b0..58368e80e5c 100755 --- a/configs/ea3131/src/ea3131_internal.h +++ b/configs/ea3131/src/ea3131_internal.h @@ -2,7 +2,7 @@ * configs/ea3131/src/ea3131_internal.h * arch/arm/src/board/ea3131_internal.n * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2009-2010 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -106,6 +106,18 @@ extern void weak_function lpc313x_spiinitialize(void); extern void weak_function lpc313x_usbinitialize(void); +/************************************************************************************ + * Name: lpc313x_pginitialize + * + * Description: + * Set up mass storage device to support on demand paging. + * + ************************************************************************************/ + +#ifdef CONFIG_PAGING +extern void weak_function lpc313x_pginitialize(void); +#endif + #endif /* __ASSEMBLY__ */ #endif /* __CONFIGS_EA3131_SRC_EA3131_INTERNAL_H */ diff --git a/configs/ea3131/src/up_boot.c b/configs/ea3131/src/up_boot.c index fc37a7ea98a..59ed9e7783f 100755 --- a/configs/ea3131/src/up_boot.c +++ b/configs/ea3131/src/up_boot.c @@ -107,4 +107,13 @@ void lpc313x_boardinitialize(void) #ifdef CONFIG_ARCH_LEDS up_ledinit(); #endif + + /* Set up mass storage device to support on demand paging */ + +#if defined(CONFIG_PAGING) + if (lpc313x_pginitialize) + { + lpc313x_pginitialize(); + } +#endif } diff --git a/configs/ea3131/src/up_fillpage.c b/configs/ea3131/src/up_fillpage.c index 2c238c9a18d..04f2e8157e4 100755 --- a/configs/ea3131/src/up_fillpage.c +++ b/configs/ea3131/src/up_fillpage.c @@ -132,4 +132,28 @@ int up_fillpage(FAR _TCB *tcb, FAR void *vpage, up_pgcallback_t pg_callback) } #endif +/************************************************************************************ + * Name: lpc313x_pginitialize + * + * Description: + * Set up mass storage device to support on demand paging. + * + ************************************************************************************/ + +void weak_function lpc313x_pginitialize(void) +{ + /* This initialization does nothing in this example setup. But this function is + * where you might, for example: + * + * - Initialize and configure a mass storage device to support on-demand paging. + * This might be, perhaps an SD card or NAND memory. An SPI FLASH would probably + * already have been configured by lpc313x_spiinitialize(void); + * - Set up resources to support up_fillpage() operation. For example, perhaps the + * the text image is stored in a named binary file. In this case, the virtual + * text addresses might map to offsets into that file. + * - Do whatever else is necessary to make up_fillpage() ready for the first time + * that it is called. + */ +} + #endif /* CONFIG_PAGING */