source: rtems/c/src/lib/libbsp/sparc/leon3/include/bsp.h @ 0729e2a7

4.115
Last change on this file since 0729e2a7 was 0729e2a7, checked in by Daniel Hellstrom <daniel@…>, on 03/28/12 at 08:49:27

SPARC: bsp_early_malloc() routine for startup memory allocation

If bsp_early_malloc() is called early during boot room will be
allocated after BSS END. If the function is called after boot
is will call malloc() instead. The returned memory is not freeable
and always 8-byte aligned.

If the bsp_early_malloc() isn't called the function is not
dragged in and the workspace will be unmodified in size.

Signed-off-by: Daniel Hellstrom <daniel@…>

  • Property mode set to 100644
File size: 3.1 KB
Line 
1/*  bsp.h
2 *
3 *  This include file contains all SPARC simulator definitions.
4 *
5 *  COPYRIGHT (c) 1989-1998.
6 *  On-Line Applications Research Corporation (OAR).
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.rtems.com/license/LICENSE.
11 *
12 *  Ported to ERC32 implementation of the SPARC by On-Line Applications
13 *  Research Corporation (OAR) under contract to the European Space
14 *  Agency (ESA).
15 *
16 *  ERC32 modifications of respective RTEMS file: COPYRIGHT (c) 1995.
17 *  European Space Agency.
18 */
19
20#ifndef _BSP_H
21#define _BSP_H
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27#include <bspopts.h>
28
29#include <rtems.h>
30#include <leon.h>
31#include <rtems/clockdrv.h>
32#include <rtems/console.h>
33
34/* SPARC CPU variant: LEON3 */
35#define LEON3 1
36
37/*
38 *  BSP provides its own Idle thread body
39 */
40void *bsp_idle_thread( uintptr_t ignored );
41#define BSP_IDLE_TASK_BODY bsp_idle_thread
42
43/*
44 * Network driver configuration
45 */
46struct rtems_bsdnet_ifconfig;
47extern int rtems_leon_open_eth_driver_attach(
48  struct rtems_bsdnet_ifconfig *config,
49  int attach
50);
51extern int rtems_smc91111_driver_attach_leon3(
52  struct rtems_bsdnet_ifconfig *config,
53  int attach
54);
55extern int rtems_leon_greth_driver_attach(
56  struct rtems_bsdnet_ifconfig *config,
57  int attach
58);
59
60#define RTEMS_BSP_NETWORK_DRIVER_NAME_OPENETH   "open_eth1"
61#define RTEMS_BSP_NETWORK_DRIVER_ATTACH_OPENETH  rtems_leon_open_eth_driver_attach
62#define RTEMS_BSP_NETWORK_DRIVER_NAME_SMC91111  "smc_eth1"
63#define RTEMS_BSP_NETWORK_DRIVER_ATTACH_SMC91111 rtems_smc91111_driver_attach_leon3
64#define RTEMS_BSP_NETWORK_DRIVER_NAME_GRETH      "gr_eth1"
65#define RTEMS_BSP_NETWORK_DRIVER_ATTACH_GRETH    rtems_leon_greth_driver_attach
66
67#ifndef RTEMS_BSP_NETWORK_DRIVER_NAME
68#define RTEMS_BSP_NETWORK_DRIVER_NAME   RTEMS_BSP_NETWORK_DRIVER_NAME_GRETH
69#define RTEMS_BSP_NETWORK_DRIVER_ATTACH RTEMS_BSP_NETWORK_DRIVER_ATTACH_GRETH
70#endif
71
72#define HAS_SMC91111
73
74/* Configure GRETH driver */
75#define GRETH_SUPPORTED
76#define GRETH_MEM_LOAD(addr) leon_r32_no_cache(addr)
77
78extern int   CPU_SPARC_HAS_SNOOPING;
79
80
81/* Constants */
82
83/*
84 *  Information placed in the linkcmds file.
85 */
86
87extern int   RAM_START;
88extern int   RAM_END;
89extern int   RAM_SIZE;
90
91extern int   PROM_START;
92extern int   PROM_END;
93extern int   PROM_SIZE;
94
95extern int   CLOCK_SPEED;
96
97extern int   end;        /* last address in the program */
98
99/* miscellaneous stuff assumed to exist */
100
101rtems_isr_entry set_vector(                     /* returns old vector */
102    rtems_isr_entry     handler,                /* isr routine        */
103    rtems_vector_number vector,                 /* vector number      */
104    int                 type                    /* RTEMS or RAW intr  */
105);
106
107void BSP_fatal_return( void );
108
109void bsp_spurious_initialize( void );
110
111/* Allocate 8-byte aligned non-freeable pre-malloc() memory. The function
112 * can be called at any time. The work-area will shrink when called before
113 * bsp_get_work_area(). malloc() is called to get memory when this function
114 * is called after bsp_get_work_area().
115 */
116void *bsp_early_malloc(int size);
117
118#ifdef __cplusplus
119}
120#endif
121
122#endif
123
124
Note: See TracBrowser for help on using the repository browser.