Mercurial > flash_v2
annotate packages/hal/powerpc/sim/current/include/hal_diag.h @ 66:bf00f99aec69 ecos-sw-2000-02-02
Merge from eCos master repository on 2000-02-02-19:16:44-GMT
| author | jlarmour |
|---|---|
| date | Wed, 02 Feb 2000 19:57:02 +0000 |
| parents | c38311975d4f |
| children | 435cced73e2f |
| 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 //============================================================================= | |
| 11 //####COPYRIGHTBEGIN#### | |
|
64
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
12 // |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
13 // ------------------------------------------- |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
14 // The contents of this file are subject to the Red Hat eCos Public License |
|
66
bf00f99aec69
Merge from eCos master repository on 2000-02-02-19:16:44-GMT
jlarmour
parents:
64
diff
changeset
|
15 // Version 1.1 (the "License"); you may not use this file except in |
|
64
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
16 // compliance with the License. You may obtain a copy of the License at |
|
66
bf00f99aec69
Merge from eCos master repository on 2000-02-02-19:16:44-GMT
jlarmour
parents:
64
diff
changeset
|
17 // http://www.redhat.com/ |
|
64
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
18 // |
|
66
bf00f99aec69
Merge from eCos master repository on 2000-02-02-19:16:44-GMT
jlarmour
parents:
64
diff
changeset
|
19 // Software distributed under the License is distributed on an "AS IS" |
|
64
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
20 // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
21 // License for the specific language governing rights and limitations under |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
22 // the License. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
23 // |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
24 // The Original Code is eCos - Embedded Configurable Operating System, |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
25 // released September 30, 1998. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
26 // |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
27 // The Initial Developer of the Original Code is Red Hat. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
28 // Portions created by Red Hat are |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
29 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
30 // All Rights Reserved. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
31 // ------------------------------------------- |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
32 // |
| 0 | 33 //####COPYRIGHTEND#### |
| 34 //============================================================================= | |
| 35 //#####DESCRIPTIONBEGIN#### | |
| 36 // | |
| 2 | 37 // Author(s): nickg |
| 38 // Contributors: nickg | |
| 39 // Date: 1999-03-23 | |
| 40 // Purpose: HAL Support for Kernel Diagnostic Routines | |
| 41 // Description: Diagnostic routines for use during kernel development. | |
| 42 // Usage: #include <cyg/hal/hal_diag.h> | |
| 0 | 43 // |
| 44 //####DESCRIPTIONEND#### | |
| 45 // | |
| 46 //============================================================================= | |
| 47 | |
| 48 #include <pkgconf/hal.h> | |
| 49 | |
| 50 #include <cyg/infra/cyg_type.h> | |
| 2 | 51 #include <cyg/hal/hal_intr.h> // HAL_DISABLE/RESTORE_INTERRUPTS macros |
| 0 | 52 |
| 53 //----------------------------------------------------------------------------- | |
| 54 // Register addresses | |
| 55 | |
| 56 #define PAL_RESET 0x00 | |
| 57 #define PAL_CPU_NR 0x04 | |
| 58 #define PAL_INT 0x08 | |
| 59 #define PAL_NR_CPU 0x0a | |
| 60 | |
| 61 #define PAL_READ_FIFO 0x10 | |
| 62 #define PAL_READ_STATUS 0x14 | |
| 63 #define PAL_WRITE_FIFO 0x18 | |
| 64 #define PAL_WRITE_STATUS 0x1a | |
| 65 | |
| 66 #define OEA_DEV 0xf0001000 | |
| 67 | |
| 68 //----------------------------------------------------------------------------- | |
| 69 | |
| 70 #define HAL_DIAG_INIT() | |
| 71 | |
| 72 #define HAL_DIAG_WRITE_CHAR(_c_) \ | |
| 2 | 73 CYG_MACRO_START \ |
| 0 | 74 volatile unsigned char *tty_buffer = \ |
| 75 (unsigned char*)(OEA_DEV + PAL_WRITE_FIFO); \ | |
| 76 volatile unsigned char *tty_status = \ | |
| 77 (unsigned char*)(OEA_DEV + PAL_WRITE_STATUS); \ | |
| 2 | 78 unsigned long __state; \ |
| 79 \ | |
| 80 HAL_DISABLE_INTERRUPTS(__state) \ | |
| 0 | 81 if( _c_ != '\r' ) \ |
| 82 { \ | |
| 83 while( *tty_status == 0 ) continue; \ | |
| 84 *tty_buffer = _c_; \ | |
| 85 } \ | |
| 2 | 86 HAL_RESTORE_INTERRUPTS(__state); \ |
| 87 CYG_MACRO_END | |
| 0 | 88 |
| 89 #define HAL_DIAG_READ_CHAR(_c_) \ | |
| 2 | 90 CYG_MACRO_START \ |
| 0 | 91 volatile unsigned char *tty_buffer = \ |
| 92 (unsigned char*)(OEA_DEV + PAL_READ_FIFO); \ | |
| 93 volatile unsigned char *tty_status = \ | |
| 94 (unsigned char*)(OEA_DEV + PAL_READ_STATUS); \ | |
| 95 while( *tty_status == 0 ) continue; \ | |
| 96 _c_ = *tty_buffer; \ | |
| 2 | 97 CYG_MACRO_END |
| 0 | 98 |
| 99 //----------------------------------------------------------------------------- | |
| 100 // end of hal_diag.h | |
| 101 #endif // CYGONCE_HAL_HAL_DIAG_H |
