diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2010-12-30 12:58:39 +0000 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2010-12-30 12:58:39 +0000 |
commit | 9812d517a13a5b5af246b55d416aa8ca04471b57 (patch) | |
tree | 6549d59b8c40c57247264ecd385d51baf59d7cb0 /c | |
parent | 2010-12-29 Sebastian Huber <sebastian.huber@embedded-brains.de> (diff) | |
download | rtems-9812d517a13a5b5af246b55d416aa8ca04471b57.tar.bz2 |
2010-12-30 Sebastian Huber <sebastian.huber@embedded-brains.de>
* shared/bspgetworkarea.c: Include <bsp/u-boot.h> if necessary.
* shared/include/u-boot.h, shared/src/bsp-uboot-board-info.c: New
files.
Diffstat (limited to 'c')
-rw-r--r-- | c/src/lib/libbsp/shared/ChangeLog | 6 | ||||
-rw-r--r-- | c/src/lib/libbsp/shared/bspgetworkarea.c | 2 | ||||
-rw-r--r-- | c/src/lib/libbsp/shared/include/u-boot.h | 38 | ||||
-rw-r--r-- | c/src/lib/libbsp/shared/src/bsp-uboot-board-info.c | 31 |
4 files changed, 76 insertions, 1 deletions
diff --git a/c/src/lib/libbsp/shared/ChangeLog b/c/src/lib/libbsp/shared/ChangeLog index cb8df6fe9e..ee584391f9 100644 --- a/c/src/lib/libbsp/shared/ChangeLog +++ b/c/src/lib/libbsp/shared/ChangeLog @@ -1,3 +1,9 @@ +2010-12-30 Sebastian Huber <sebastian.huber@embedded-brains.de> + + * shared/bspgetworkarea.c: Include <bsp/u-boot.h> if necessary. + * shared/include/u-boot.h, shared/src/bsp-uboot-board-info.c: New + files. + 2010-10-14 Sebastian Huber <sebastian.huber@embedded-brains.de> * include/utility.h: Renamed macros. diff --git a/c/src/lib/libbsp/shared/bspgetworkarea.c b/c/src/lib/libbsp/shared/bspgetworkarea.c index e646e32894..3f9974f362 100644 --- a/c/src/lib/libbsp/shared/bspgetworkarea.c +++ b/c/src/lib/libbsp/shared/bspgetworkarea.c @@ -31,7 +31,7 @@ extern char HeapSize[]; * We may get the size information from U-Boot or the linker scripts. */ #ifdef HAS_UBOOT - extern bd_t bsp_uboot_board_info; + #include <bsp/u-boot.h> #else extern char RamBase[]; extern char RamSize[]; diff --git a/c/src/lib/libbsp/shared/include/u-boot.h b/c/src/lib/libbsp/shared/include/u-boot.h new file mode 100644 index 0000000000..3f79952392 --- /dev/null +++ b/c/src/lib/libbsp/shared/include/u-boot.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2010 embedded brains GmbH. All rights reserved. + * + * embedded brains GmbH + * Obere Lagerstr. 30 + * 82178 Puchheim + * Germany + * <rtems@embedded-brains.de> + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + * + * $Id$ + */ + +#ifndef LIBBSP_SHARED_U_BOOT_H +#define LIBBSP_SHARED_U_BOOT_H + +#include <bsp/u-boot-config.h> + +typedef unsigned long phys_size_t; + +#include <bsp/u-boot-board-info.h> + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +extern bd_t bsp_uboot_board_info; + +void bsp_uboot_copy_board_info(const bd_t *src); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* LIBBSP_SHARED_U_BOOT_H */ diff --git a/c/src/lib/libbsp/shared/src/bsp-uboot-board-info.c b/c/src/lib/libbsp/shared/src/bsp-uboot-board-info.c new file mode 100644 index 0000000000..65c2605213 --- /dev/null +++ b/c/src/lib/libbsp/shared/src/bsp-uboot-board-info.c @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2010 embedded brains GmbH. All rights reserved. + * + * embedded brains GmbH + * Obere Lagerstr. 30 + * 82178 Puchheim + * Germany + * <rtems@embedded-brains.de> + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + * + * $Id$ + */ + +#include <bsp/u-boot.h> + +bd_t bsp_uboot_board_info; + +void bsp_uboot_copy_board_info(const bd_t *src) +{ + const int *s = (const int *) src; + int *d = (int *) &bsp_uboot_board_info; + int i = 0; + int n = sizeof(*src) / sizeof(int); + + for (i = 0; i < n; ++i) { + d [i] = s [i]; + } +} |