annotate packages/hal/powerpc/sim/current/include/hal_diag.h @ 3292:7f8e529b4d82 default tip

Fix FREESCALE_EDMA_NBYTES_MLOFFYES_MLOFF() so it works with negative offsets.
author vae
date Wed, 29 Apr 2015 23:31:48 +0000
parents 74dbf4c3f2e1
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
1 #ifndef CYGONCE_HAL_HAL_DIAG_H
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
2 #define CYGONCE_HAL_HAL_DIAG_H
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
3
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
4 //=============================================================================
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
5 //
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
6 // hal_diag.h
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
7 //
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
8 // HAL Support for Kernel Diagnostic Routines
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
9 //
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
10 //=============================================================================
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
11 // ####ECOSGPLCOPYRIGHTBEGIN####
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
12 // -------------------------------------------
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
13 // This file is part of eCos, the Embedded Configurable Operating System.
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
14 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
208
e0c0827131d1 Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents: 76
diff changeset
15 //
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
16 // eCos is free software; you can redistribute it and/or modify it under
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
17 // the terms of the GNU General Public License as published by the Free
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
18 // Software Foundation; either version 2 or (at your option) any later
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
19 // version.
208
e0c0827131d1 Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents: 76
diff changeset
20 //
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
21 // eCos is distributed in the hope that it will be useful, but WITHOUT
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
22 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
23 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
24 // for more details.
208
e0c0827131d1 Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents: 76
diff changeset
25 //
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
26 // You should have received a copy of the GNU General Public License
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
27 // along with eCos; if not, write to the Free Software Foundation, Inc.,
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
28 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
208
e0c0827131d1 Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents: 76
diff changeset
29 //
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
30 // As a special exception, if other files instantiate templates or use
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
31 // macros or inline functions from this file, or you compile this file
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
32 // and link it with other works to produce a work based on this file,
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
33 // this file does not by itself cause the resulting work to be covered by
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
34 // the GNU General Public License. However the source code for this file
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
35 // must still be made available in accordance with section (3) of the GNU
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
36 // General Public License v2.
208
e0c0827131d1 Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents: 76
diff changeset
37 //
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
38 // This exception does not invalidate any other reasons why a work based
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
39 // on this file might be covered by the GNU General Public License.
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
40 // -------------------------------------------
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 210
diff changeset
41 // ####ECOSGPLCOPYRIGHTEND####
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
42 //=============================================================================
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
43 //#####DESCRIPTIONBEGIN####
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
44 //
2
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
45 // Author(s): nickg
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
46 // Contributors: nickg
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
47 // Date: 1999-03-23
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
48 // Purpose: HAL Support for Kernel Diagnostic Routines
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
49 // Description: Diagnostic routines for use during kernel development.
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
50 // Usage: #include <cyg/hal/hal_diag.h>
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
51 //
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
52 //####DESCRIPTIONEND####
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
53 //
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
54 //=============================================================================
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
55
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
56 #include <pkgconf/hal.h>
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
57
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
58 #include <cyg/infra/cyg_type.h>
2
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
59 #include <cyg/hal/hal_intr.h> // HAL_DISABLE/RESTORE_INTERRUPTS macros
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
60
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
61 //-----------------------------------------------------------------------------
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
62 // Register addresses
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
63
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
64 #define PAL_RESET 0x00
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
65 #define PAL_CPU_NR 0x04
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
66 #define PAL_INT 0x08
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
67 #define PAL_NR_CPU 0x0a
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
68
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
69 #define PAL_READ_FIFO 0x10
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
70 #define PAL_READ_STATUS 0x14
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
71 #define PAL_WRITE_FIFO 0x18
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
72 #define PAL_WRITE_STATUS 0x1a
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
73
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
74 #define OEA_DEV 0xf0001000
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
75
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
76 //-----------------------------------------------------------------------------
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
77
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
78 #define HAL_DIAG_INIT()
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
79
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
80 #define HAL_DIAG_WRITE_CHAR(_c_) \
2
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
81 CYG_MACRO_START \
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
82 volatile unsigned char *tty_buffer = \
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
83 (unsigned char*)(OEA_DEV + PAL_WRITE_FIFO); \
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
84 volatile unsigned char *tty_status = \
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
85 (unsigned char*)(OEA_DEV + PAL_WRITE_STATUS); \
2
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
86 unsigned long __state; \
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
87 \
76
435cced73e2f eCos v1.3.1 merged from eCos master repository on 2000-03-27-23:22:51-BST
jlarmour
parents: 66
diff changeset
88 HAL_DISABLE_INTERRUPTS(__state); \
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
89 if( _c_ != '\r' ) \
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
90 { \
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
91 while( *tty_status == 0 ) continue; \
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
92 *tty_buffer = _c_; \
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
93 } \
2
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
94 HAL_RESTORE_INTERRUPTS(__state); \
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
95 CYG_MACRO_END
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
96
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
97 #define HAL_DIAG_READ_CHAR(_c_) \
2
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
98 CYG_MACRO_START \
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
99 volatile unsigned char *tty_buffer = \
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
100 (unsigned char*)(OEA_DEV + PAL_READ_FIFO); \
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
101 volatile unsigned char *tty_status = \
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
102 (unsigned char*)(OEA_DEV + PAL_READ_STATUS); \
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
103 while( *tty_status == 0 ) continue; \
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
104 _c_ = *tty_buffer; \
2
443894e2e912 Block commit of eCos version 1.2.1
jlarmour
parents: 0
diff changeset
105 CYG_MACRO_END
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
106
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
107 //-----------------------------------------------------------------------------
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
108 // end of hal_diag.h
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
109 #endif // CYGONCE_HAL_HAL_DIAG_H