Mercurial > ecos
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 |
| rev | line source |
|---|---|
| 0 | 1 #ifndef CYGONCE_HAL_HAL_DIAG_H |
| 2 #define CYGONCE_HAL_HAL_DIAG_H | |
| 3 | |
| 4 //============================================================================= | |
| 5 // | |
| 6 // hal_diag.h | |
| 7 // | |
| 8 // HAL Support for Kernel Diagnostic Routines | |
| 9 // | |
| 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 | 42 //============================================================================= |
| 43 //#####DESCRIPTIONBEGIN#### | |
| 44 // | |
| 2 | 45 // Author(s): nickg |
| 46 // Contributors: nickg | |
| 47 // Date: 1999-03-23 | |
| 48 // Purpose: HAL Support for Kernel Diagnostic Routines | |
| 49 // Description: Diagnostic routines for use during kernel development. | |
| 50 // Usage: #include <cyg/hal/hal_diag.h> | |
| 0 | 51 // |
| 52 //####DESCRIPTIONEND#### | |
| 53 // | |
| 54 //============================================================================= | |
| 55 | |
| 56 #include <pkgconf/hal.h> | |
| 57 | |
| 58 #include <cyg/infra/cyg_type.h> | |
| 2 | 59 #include <cyg/hal/hal_intr.h> // HAL_DISABLE/RESTORE_INTERRUPTS macros |
| 0 | 60 |
| 61 //----------------------------------------------------------------------------- | |
| 62 // Register addresses | |
| 63 | |
| 64 #define PAL_RESET 0x00 | |
| 65 #define PAL_CPU_NR 0x04 | |
| 66 #define PAL_INT 0x08 | |
| 67 #define PAL_NR_CPU 0x0a | |
| 68 | |
| 69 #define PAL_READ_FIFO 0x10 | |
| 70 #define PAL_READ_STATUS 0x14 | |
| 71 #define PAL_WRITE_FIFO 0x18 | |
| 72 #define PAL_WRITE_STATUS 0x1a | |
| 73 | |
| 74 #define OEA_DEV 0xf0001000 | |
| 75 | |
| 76 //----------------------------------------------------------------------------- | |
| 77 | |
| 78 #define HAL_DIAG_INIT() | |
| 79 | |
| 80 #define HAL_DIAG_WRITE_CHAR(_c_) \ | |
| 2 | 81 CYG_MACRO_START \ |
| 0 | 82 volatile unsigned char *tty_buffer = \ |
| 83 (unsigned char*)(OEA_DEV + PAL_WRITE_FIFO); \ | |
| 84 volatile unsigned char *tty_status = \ | |
| 85 (unsigned char*)(OEA_DEV + PAL_WRITE_STATUS); \ | |
| 2 | 86 unsigned long __state; \ |
| 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 | 89 if( _c_ != '\r' ) \ |
| 90 { \ | |
| 91 while( *tty_status == 0 ) continue; \ | |
| 92 *tty_buffer = _c_; \ | |
| 93 } \ | |
| 2 | 94 HAL_RESTORE_INTERRUPTS(__state); \ |
| 95 CYG_MACRO_END | |
| 0 | 96 |
| 97 #define HAL_DIAG_READ_CHAR(_c_) \ | |
| 2 | 98 CYG_MACRO_START \ |
| 0 | 99 volatile unsigned char *tty_buffer = \ |
| 100 (unsigned char*)(OEA_DEV + PAL_READ_FIFO); \ | |
| 101 volatile unsigned char *tty_status = \ | |
| 102 (unsigned char*)(OEA_DEV + PAL_READ_STATUS); \ | |
| 103 while( *tty_status == 0 ) continue; \ | |
| 104 _c_ = *tty_buffer; \ | |
| 2 | 105 CYG_MACRO_END |
| 0 | 106 |
| 107 //----------------------------------------------------------------------------- | |
| 108 // end of hal_diag.h | |
| 109 #endif // CYGONCE_HAL_HAL_DIAG_H |
