Mercurial > flash_v2
annotate packages/hal/powerpc/sim/current/include/hal_diag.h @ 1777:c16341b1bac6 default tip
* Added execute permissions to files missed in conversion from CVS
| author | alexs |
|---|---|
| date | Mon, 12 Oct 2009 02:26:09 +0100 |
| parents | d2c90368aeef |
| 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 //============================================================================= | |
|
208
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
76
diff
changeset
|
11 //####ECOSGPLCOPYRIGHTBEGIN#### |
|
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
76
diff
changeset
|
12 // ------------------------------------------- |
|
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
76
diff
changeset
|
13 // This file is part of eCos, the Embedded Configurable Operating System. |
|
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
76
diff
changeset
|
14 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. |
|
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
76
diff
changeset
|
15 // |
|
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
76
diff
changeset
|
16 // eCos is free software; you can redistribute it and/or modify it under |
|
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
76
diff
changeset
|
17 // the terms of the GNU General Public License as published by the Free |
|
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
76
diff
changeset
|
18 // Software Foundation; either version 2 or (at your option) any later version. |
|
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
76
diff
changeset
|
19 // |
|
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
76
diff
changeset
|
20 // eCos is distributed in the hope that it will be useful, but WITHOUT ANY |
|
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
76
diff
changeset
|
21 // WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
76
diff
changeset
|
22 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
76
diff
changeset
|
23 // for more details. |
|
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
76
diff
changeset
|
24 // |
|
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
76
diff
changeset
|
25 // You should have received a copy of the GNU General Public License along |
|
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
76
diff
changeset
|
26 // with eCos; if not, write to the Free Software Foundation, Inc., |
|
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
76
diff
changeset
|
27 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. |
|
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
76
diff
changeset
|
28 // |
|
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
76
diff
changeset
|
29 // As a special exception, if other files instantiate templates or use macros |
|
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
76
diff
changeset
|
30 // or inline functions from this file, or you compile this file and link it |
|
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
76
diff
changeset
|
31 // with other works to produce a work based on this file, this file does not |
|
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
76
diff
changeset
|
32 // by itself cause the resulting work to be covered by the GNU General Public |
|
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
76
diff
changeset
|
33 // License. However the source code for this file must still be made available |
|
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
76
diff
changeset
|
34 // in accordance with section (3) of the GNU General Public License. |
|
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
76
diff
changeset
|
35 // |
|
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
76
diff
changeset
|
36 // This exception does not invalidate any other reasons why a work based on |
|
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
76
diff
changeset
|
37 // this file might be covered by the GNU General Public License. |
|
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
76
diff
changeset
|
38 // |
|
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
76
diff
changeset
|
39 // Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. |
|
210
d2c90368aeef
Merge from eCos master repository on 2002-05-23-21:39:14-BST
jlarmour
parents:
208
diff
changeset
|
40 // at http://sources.redhat.com/ecos/ecos-license/ |
|
208
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
76
diff
changeset
|
41 // ------------------------------------------- |
|
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
76
diff
changeset
|
42 //####ECOSGPLCOPYRIGHTEND#### |
| 0 | 43 //============================================================================= |
| 44 //#####DESCRIPTIONBEGIN#### | |
| 45 // | |
| 2 | 46 // Author(s): nickg |
| 47 // Contributors: nickg | |
| 48 // Date: 1999-03-23 | |
| 49 // Purpose: HAL Support for Kernel Diagnostic Routines | |
| 50 // Description: Diagnostic routines for use during kernel development. | |
| 51 // Usage: #include <cyg/hal/hal_diag.h> | |
| 0 | 52 // |
| 53 //####DESCRIPTIONEND#### | |
| 54 // | |
| 55 //============================================================================= | |
| 56 | |
| 57 #include <pkgconf/hal.h> | |
| 58 | |
| 59 #include <cyg/infra/cyg_type.h> | |
| 2 | 60 #include <cyg/hal/hal_intr.h> // HAL_DISABLE/RESTORE_INTERRUPTS macros |
| 0 | 61 |
| 62 //----------------------------------------------------------------------------- | |
| 63 // Register addresses | |
| 64 | |
| 65 #define PAL_RESET 0x00 | |
| 66 #define PAL_CPU_NR 0x04 | |
| 67 #define PAL_INT 0x08 | |
| 68 #define PAL_NR_CPU 0x0a | |
| 69 | |
| 70 #define PAL_READ_FIFO 0x10 | |
| 71 #define PAL_READ_STATUS 0x14 | |
| 72 #define PAL_WRITE_FIFO 0x18 | |
| 73 #define PAL_WRITE_STATUS 0x1a | |
| 74 | |
| 75 #define OEA_DEV 0xf0001000 | |
| 76 | |
| 77 //----------------------------------------------------------------------------- | |
| 78 | |
| 79 #define HAL_DIAG_INIT() | |
| 80 | |
| 81 #define HAL_DIAG_WRITE_CHAR(_c_) \ | |
| 2 | 82 CYG_MACRO_START \ |
| 0 | 83 volatile unsigned char *tty_buffer = \ |
| 84 (unsigned char*)(OEA_DEV + PAL_WRITE_FIFO); \ | |
| 85 volatile unsigned char *tty_status = \ | |
| 86 (unsigned char*)(OEA_DEV + PAL_WRITE_STATUS); \ | |
| 2 | 87 unsigned long __state; \ |
| 88 \ | |
|
76
435cced73e2f
eCos v1.3.1 merged from eCos master repository on 2000-03-27-23:22:51-BST
jlarmour
parents:
66
diff
changeset
|
89 HAL_DISABLE_INTERRUPTS(__state); \ |
| 0 | 90 if( _c_ != '\r' ) \ |
| 91 { \ | |
| 92 while( *tty_status == 0 ) continue; \ | |
| 93 *tty_buffer = _c_; \ | |
| 94 } \ | |
| 2 | 95 HAL_RESTORE_INTERRUPTS(__state); \ |
| 96 CYG_MACRO_END | |
| 0 | 97 |
| 98 #define HAL_DIAG_READ_CHAR(_c_) \ | |
| 2 | 99 CYG_MACRO_START \ |
| 0 | 100 volatile unsigned char *tty_buffer = \ |
| 101 (unsigned char*)(OEA_DEV + PAL_READ_FIFO); \ | |
| 102 volatile unsigned char *tty_status = \ | |
| 103 (unsigned char*)(OEA_DEV + PAL_READ_STATUS); \ | |
| 104 while( *tty_status == 0 ) continue; \ | |
| 105 _c_ = *tty_buffer; \ | |
| 2 | 106 CYG_MACRO_END |
| 0 | 107 |
| 108 //----------------------------------------------------------------------------- | |
| 109 // end of hal_diag.h | |
| 110 #endif // CYGONCE_HAL_HAL_DIAG_H |
