source: rtems/cpukit/score/cpu/sparc/include/rtems/score/sparcimpl.h @ d0dd98c

Last change on this file since d0dd98c was d0dd98c, checked in by Sebastian Huber <sebastian.huber@…>, on 03/15/23 at 07:55:12

sparc: Add header files to Doxygen group

  • Property mode set to 100644
File size: 3.4 KB
Line 
1/* SPDX-License-Identifier: BSD-2-Clause */
2
3/**
4 * @file
5 *
6 * @ingroup RTEMSScoreCPUSPARC
7 *
8 * @brief This header file provides interfaces used by the SPARC port of RTEMS.
9 */
10
11/*
12 * Copyright (c) 2016, 2018 embedded brains GmbH.  All rights reserved.
13 *
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions
16 * are met:
17 * 1. Redistributions of source code must retain the above copyright
18 *    notice, this list of conditions and the following disclaimer.
19 * 2. Redistributions in binary form must reproduce the above copyright
20 *    notice, this list of conditions and the following disclaimer in the
21 *    documentation and/or other materials provided with the distribution.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 * POSSIBILITY OF SUCH DAMAGE.
34 */
35
36#ifndef _RTEMS_SCORE_SPARCIMPL_H
37#define _RTEMS_SCORE_SPARCIMPL_H
38
39#include <rtems/score/cpu.h>
40
41#ifdef __cplusplus
42extern "C" {
43#endif /* __cplusplus */
44
45struct timecounter;
46
47/*
48 * Provides a mutable alias to _SPARC_Counter for use in
49 * _SPARC_Counter_initialize().  The _SPARC_Counter and _SPARC_Counter_mutable
50 * are defined via the SPARC_COUNTER_DEFINITION define.
51 */
52extern SPARC_Counter _SPARC_Counter_mutable;
53
54void _SPARC_Counter_at_tick_clock( void );
55
56CPU_Counter_ticks _SPARC_Counter_read_default( void );
57
58CPU_Counter_ticks _SPARC_Counter_read_up( void );
59
60CPU_Counter_ticks _SPARC_Counter_read_down( void );
61
62CPU_Counter_ticks _SPARC_Counter_read_clock_isr_disabled( void );
63
64CPU_Counter_ticks _SPARC_Counter_read_clock( void );
65
66CPU_Counter_ticks _SPARC_Counter_read_asr23( void );
67
68uint32_t _SPARC_Get_timecount_up( struct timecounter * );
69
70uint32_t _SPARC_Get_timecount_down( struct timecounter * );
71
72uint32_t _SPARC_Get_timecount_clock( struct timecounter * );
73
74uint32_t _SPARC_Get_timecount_asr23( struct timecounter * );
75
76/*
77 * Defines the _SPARC_Counter and _SPARC_Counter_mutable global variables.
78 * Place this define in the global file scope of the CPU counter support file
79 * of the BSP.
80 */
81#define SPARC_COUNTER_DEFINITION \
82  __asm__ ( \
83    "\t.global\t_SPARC_Counter\n" \
84    "\t.global\t_SPARC_Counter_mutable\n" \
85    "\t.section\t.data._SPARC_Counter,\"aw\",@progbits\n" \
86    "\t.align\t4\n" \
87    "\t.type\t_SPARC_Counter, #object\n" \
88    "\t.size\t_SPARC_Counter, 28\n" \
89    "_SPARC_Counter:\n" \
90    "_SPARC_Counter_mutable:\n" \
91    "\t.long\t_SPARC_Counter_read_default\n" \
92    "\t.long\t_SPARC_Counter_read_default\n" \
93    "\t.long\t0\n" \
94    "\t.long\t0\n" \
95    "\t.long\t0\n" \
96    "\t.long\t0\n" \
97    "\t.long\t0\n" \
98    "\t.previous\n" \
99  )
100
101#ifdef __cplusplus
102}
103#endif /* __cplusplus */
104
105#endif /* _RTEMS_SCORE_SPARCIMPL_H */
Note: See TracBrowser for help on using the repository browser.