source: rtems/c/src/lib/libbsp/sparc/leon3/startup/bspstart.c @ 44b06ca

4.104.115
Last change on this file since 44b06ca was 44b06ca, checked in by Ralf Corsepius <ralf.corsepius@…>, on 11/29/09 at 15:33:28

Whitespace removal.

  • Property mode set to 100644
File size: 1.2 KB
Line 
1/*
2 *  This set of routines starts the application.  It includes application,
3 *  board, and monitor specific initialization and configuration.
4 *  The generic CPU dependent initialization has been performed
5 *  before any of these are invoked.
6 *
7 *  COPYRIGHT (c) 1989-2007.
8 *  On-Line Applications Research Corporation (OAR).
9 *
10 *  Modified for LEON3 BSP.
11 *  COPYRIGHT (c) 2004.
12 *  Gaisler Research.
13 *
14 *  The license and distribution terms for this file may be
15 *  found in the file LICENSE in this distribution or at
16 *  http://www.rtems.com/license/LICENSE.
17 *
18 *  $Id$
19 */
20
21
22#include <bsp.h>
23#include <rtems/bspIo.h>
24
25/*
26 * Tells us if data cache snooping is available
27 */
28int CPU_SPARC_HAS_SNOOPING;
29
30/*
31 * set_snooping
32 *
33 * Read the data cache configuration register to determine if
34 * bus snooping is available. This is needed for some drivers so
35 * that they can select the most efficient copy routines.
36 *
37 */
38
39static inline int set_snooping(void)
40{
41  int tmp;
42  asm(" lda [%1] 2, %0 "
43      : "=r"(tmp)
44      : "r"(0xC)
45  );
46  return (tmp >> 27) & 1;
47}
48
49/*
50 *  bsp_start
51 *
52 *  This routine does the bulk of the system initialization.
53 */
54void bsp_start( void )
55{
56  CPU_SPARC_HAS_SNOOPING = set_snooping();
57}
Note: See TracBrowser for help on using the repository browser.