Changeset 8430205 in rtems
- Timestamp:
- 04/12/04 22:04:28 (19 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- e69307b7
- Parents:
- db87589
- Location:
- c/src/lib/libcpu/powerpc
- Files:
-
- 12 added
- 1 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/lib/libcpu/powerpc/ChangeLog
rdb87589 r8430205 1 2004-04-12 David Querbach <querbach@realtime.bc.ca> 2 3 * README, configure.ac, mpc5xx/Makefile.am, 4 mpc5xx/exceptions/raw_exception.c, mpc5xx/exceptions/raw_exception.h, 5 mpc5xx/timer/timer.c, shared/include/cpuIdent.h: addition of a 6 significant amount of MPC5xx support as part of the addition of the 7 SS555 BSP. 8 * mpc5xx/README, mpc5xx/clock/clock.c, 9 mpc5xx/console-generic/console-generic.c, mpc5xx/include/console.h, 10 mpc5xx/include/mpc5xx.h, mpc5xx/irq/irq.c, mpc5xx/irq/irq.h, 11 mpc5xx/irq/irq_asm.S, mpc5xx/irq/irq_init.c, 12 mpc5xx/vectors/vectors.S, mpc5xx/vectors/vectors.h, 13 mpc5xx/vectors/vectors_init.c: New files. 14 * mpc5xx/exceptions/asm_utils.S: Removed. 15 1 16 2004-04-02 Ralf Corsepius <ralf_corsepius@rtems.org> 2 17 -
c/src/lib/libcpu/powerpc/README
rdb87589 r8430205 14 14 15 15 + mpc505 16 + mpc5xx ( mpc565)16 + mpc5xx (5xx devices other than 505/509) 17 17 + mpc6xx 18 18 + mpc750 -
c/src/lib/libcpu/powerpc/configure.ac
rdb87589 r8430205 23 23 24 24 AM_CONDITIONAL(shared, \ 25 test "$RTEMS_CPU_MODEL" = "mpc5xx" \ 26 || test "$RTEMS_CPU_MODEL" = "mpc750" \ 25 test "$RTEMS_CPU_MODEL" = "mpc750" \ 27 26 || test "$RTEMS_CPU_MODEL" = "mpc7400" \ 27 || test "$RTEMS_CPU_MODEL" = "mpc555" \ 28 || test "$RTEMS_CPU_MODEL" = "mpc5xx" \ 28 29 || test "$RTEMS_CPU_MODEL" = "ppc603e" \ 29 30 || test "$RTEMS_CPU_MODEL" = "mpc604" \ … … 36 37 ## test on CPU type 37 38 AM_CONDITIONAL(mpc505, test "$RTEMS_CPU_MODEL" = "mpc505") 38 AM_CONDITIONAL(mpc5xx, test "$RTEMS_CPU_MODEL" = "mpc5xx") 39 AM_CONDITIONAL(mpc5xx, test "$RTEMS_CPU_MODEL" = "mpc5xx" \ 40 || test "$RTEMS_CPU_MODEL" = "mpc555" ) 39 41 AM_CONDITIONAL(mpc6xx, test "$RTEMS_CPU_MODEL" = "mpc6xx" \ 40 42 || test "$RTEMS_CPU_MODEL" = "mpc604" \ -
c/src/lib/libcpu/powerpc/mpc5xx/Makefile.am
rdb87589 r8430205 11 11 12 12 if mpc5xx 13 include_mpc5xxdir = $(includedir)/mpc5xx 13 14 include_libcpudir = $(includedir)/libcpu 14 15 15 # exceptions 16 include_HEADERS = include/mpc5xx.h 17 18 ## clock 19 EXTRA_PROGRAMS += clock.rel 20 CLEANFILES += clock.rel 21 clock_rel_SOURCES = clock/clock.c 22 clock_rel_CPPFLAGS = $(AM_CPPFLAGS) $(CFLAGS_OPTIMIZE_V) 23 clock_rel_LDFLAGS = $(RTEMS_RELLDFLAGS) 24 25 EXTRA_PROGRAMS += clock_g.rel 26 CLEANFILES += clock_g.rel 27 clock_g_rel_SOURCES = $(clock_rel_SOURCES) 28 clock_g_rel_CPPFLAGS = $(AM_CPPFLAGS) $(CFLAGS_DEBUG_V) 29 clock_g_rel_LDFLAGS = $(RTEMS_RELLDFLAGS) 30 31 noinst_DATA += clock$(LIB_VARIANT).rel 32 33 ## console-generic 34 include_mpc5xx_HEADERS = include/console.h 35 36 EXTRA_PROGRAMS += console-generic.rel 37 CLEANFILES += console-generic.rel 38 console_generic_rel_SOURCES = console-generic/console-generic.c 39 console_generic_rel_CPPFLAGS = $(AM_CPPFLAGS) $(CFLAGS_OPTIMIZE_V) 40 console_generic_rel_LDFLAGS = $(RTEMS_RELLDFLAGS) 41 42 EXTRA_PROGRAMS += console-generic_g.rel 43 CLEANFILES += console-generic_g.rel 44 console_generic_g_rel_SOURCES = $(console_generic_rel_SOURCES) 45 console_generic_g_rel_CPPFLAGS = $(AM_CPPFLAGS) $(CFLAGS_DEBUG_V) 46 console_generic_g_rel_LDFLAGS = $(RTEMS_RELLDFLAGS) 47 48 noinst_DATA += console-generic$(LIB_VARIANT).rel 49 50 ## exceptions 16 51 include_libcpu_HEADERS = exceptions/raw_exception.h 17 52 18 53 EXTRA_PROGRAMS += exceptions.rel 19 54 CLEANFILES += exceptions.rel 20 exceptions_rel_SOURCES = exceptions/raw_exception.c exceptions/asm_utils.S55 exceptions_rel_SOURCES = exceptions/raw_exception.c 21 56 exceptions_rel_CPPFLAGS = $(AM_CPPFLAGS) $(CFLAGS_OPTIMIZE_V) 22 57 exceptions_rel_LDFLAGS = $(RTEMS_RELLDFLAGS) … … 30 65 noinst_DATA += exceptions$(LIB_VARIANT).rel 31 66 32 # ictrl33 include_ HEADERS = ictrl/ictrl.h67 ## irq 68 include_libcpu_HEADERS += irq/irq.h 34 69 35 EXTRA_PROGRAMS += i ctrl.rel36 CLEANFILES += i ctrl.rel37 i ctrl_rel_SOURCES = ictrl/ictrl.c ictrl/ictrl.h38 i ctrl_rel_CPPFLAGS = $(AM_CPPFLAGS) $(CFLAGS_OPTIMIZE_V)39 i ctrl_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)70 EXTRA_PROGRAMS += irq.rel 71 CLEANFILES += irq.rel 72 irq_rel_SOURCES = irq/irq.c irq/irq_init.c irq/irq_asm.S 73 irq_rel_CPPFLAGS = $(AM_CPPFLAGS) $(CFLAGS_OPTIMIZE_V) 74 irq_rel_LDFLAGS = $(RTEMS_RELLDFLAGS) 40 75 41 EXTRA_PROGRAMS += i ctrl_g.rel42 CLEANFILES += i ctrl_g.rel43 i ctrl_g_rel_SOURCES = $(ictrl_rel_SOURCES)44 i ctrl_g_rel_CPPFLAGS = $(AM_CPPFLAGS) $(CFLAGS_DEBUG_V)45 i ctrl_g_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)76 EXTRA_PROGRAMS += irq_g.rel 77 CLEANFILES += irq_g.rel 78 irq_g_rel_SOURCES = $(irq_rel_SOURCES) 79 irq_g_rel_CPPFLAGS = $(AM_CPPFLAGS) $(CFLAGS_DEBUG_V) 80 irq_g_rel_LDFLAGS = $(RTEMS_RELLDFLAGS) 46 81 47 noinst_DATA += i ctrl$(LIB_VARIANT).rel82 noinst_DATA += irq$(LIB_VARIANT).rel 48 83 49 # timer84 ## timer 50 85 EXTRA_PROGRAMS += timer.rel 51 86 CLEANFILES += timer.rel … … 61 96 62 97 noinst_DATA += timer$(LIB_VARIANT).rel 98 99 ## vectors 100 include_libcpu_HEADERS += vectors/vectors.h 101 102 EXTRA_PROGRAMS += vectors.rel 103 CLEANFILES += vectors.rel 104 vectors_rel_SOURCES = vectors/vectors_init.c vectors/vectors.S 105 vectors_rel_CPPFLAGS = $(AM_CPPFLAGS) $(CFLAGS_OPTIMIZE_V) 106 vectors_rel_LDFLAGS = $(RTEMS_RELLDFLAGS) 107 108 EXTRA_PROGRAMS += vectors_g.rel 109 CLEANFILES += vectors_g.rel 110 vectors_g_rel_SOURCES = $(vectors_rel_SOURCES) 111 vectors_g_rel_CPPFLAGS = $(AM_CPPFLAGS) $(CFLAGS_DEBUG_V) 112 vectors_g_rel_LDFLAGS = $(RTEMS_RELLDFLAGS) 113 114 noinst_DATA += vectors$(LIB_VARIANT).rel 63 115 endif 116 117 ## -- 118 all-local: $(PREINSTALL_FILES) 64 119 65 120 PREINSTALL_DIRS = … … 72 127 73 128 if mpc5xx 129 $(PROJECT_INCLUDE)/mpc5xx/$(dirstamp): 130 @$(mkdir_p) $(PROJECT_INCLUDE)/mpc5xx 131 @: > $(PROJECT_INCLUDE)/mpc5xx/$(dirstamp) 132 PREINSTALL_DIRS += $(PROJECT_INCLUDE)/mpc5xx/$(dirstamp) 133 74 134 $(PROJECT_INCLUDE)/libcpu/$(dirstamp): 75 135 @$(mkdir_p) $(PROJECT_INCLUDE)/libcpu … … 77 137 PREINSTALL_DIRS += $(PROJECT_INCLUDE)/libcpu/$(dirstamp) 78 138 139 $(PROJECT_INCLUDE)/mpc5xx.h: include/mpc5xx.h $(PROJECT_INCLUDE)/$(dirstamp) 140 $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/mpc5xx.h 141 PREINSTALL_FILES += $(PROJECT_INCLUDE)/mpc5xx.h 142 143 $(PROJECT_INCLUDE)/mpc5xx/console.h: include/console.h $(PROJECT_INCLUDE)/mpc5xx/$(dirstamp) 144 $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/mpc5xx/console.h 145 PREINSTALL_FILES += $(PROJECT_INCLUDE)/mpc5xx/console.h 146 79 147 $(PROJECT_INCLUDE)/libcpu/raw_exception.h: exceptions/raw_exception.h $(PROJECT_INCLUDE)/libcpu/$(dirstamp) 80 148 $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/libcpu/raw_exception.h 81 149 PREINSTALL_FILES += $(PROJECT_INCLUDE)/libcpu/raw_exception.h 82 150 83 $(PROJECT_INCLUDE)/ictrl.h: ictrl/ictrl.h $(PROJECT_INCLUDE)/$(dirstamp) 84 $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/ictrl.h 85 PREINSTALL_FILES += $(PROJECT_INCLUDE)/ictrl.h 151 $(PROJECT_INCLUDE)/libcpu/irq.h: irq/irq.h $(PROJECT_INCLUDE)/libcpu/$(dirstamp) 152 $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/libcpu/irq.h 153 PREINSTALL_FILES += $(PROJECT_INCLUDE)/libcpu/irq.h 154 155 $(PROJECT_INCLUDE)/libcpu/vectors.h: vectors/vectors.h $(PROJECT_INCLUDE)/libcpu/$(dirstamp) 156 $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/libcpu/vectors.h 157 PREINSTALL_FILES += $(PROJECT_INCLUDE)/libcpu/vectors.h 86 158 endif 87 159 … … 89 161 DISTCLEANFILES = $(PREINSTALL_DIRS) 90 162 91 include $(top_srcdir)/../../../ ../../automake/local.am163 include $(top_srcdir)/../../../automake/local.am -
c/src/lib/libcpu/powerpc/mpc5xx/exceptions/raw_exception.c
rdb87589 r8430205 1 1 /* 2 * raw_exception.c - This file contains implementation of C function to3 * Instan ciate 8xx ppcprimary exception entries.4 * More detailled information can be found on motorola5 * site and more precisely in the following book 2 * raw_exception.c - This file contains implementation of C functions to 3 * Instantiate mpc5xx primary exception entries. 4 * More detailled information can be found on the Motorola 5 * site and more precisely in the following book: 6 6 * 7 * MPC860 8 * Risc Microporcessor User's Manual 9 * Motorola REF : MPC860UM/AD 7 * MPC555/MPC556 User's Manual 8 * Motorola REF : MPC555UM/D Rev. 3, 2000 October 15 9 * 10 * 11 * MPC5xx port sponsored by Defence Research and Development Canada - Suffield 12 * Copyright (C) 2004, Real-Time Systems Inc. (querbach@realtime.bc.ca) 13 * 14 * Derived from libcpu/powerpc/mpc8xx/exceptions/raw_exception.c: 10 15 * 11 16 * Copyright (C) 1999 Eric Valette (valette@crf.canon.fr) 12 17 * Canon Centre Recherche France. 13 18 * 14 * Changes for MPC5XX Wilfried Busalski (w.busalski@lancier-monitoring.de)15 * Copyright (C) 2003 Lancier Monitoring GmbH16 *17 19 * The license and distribution terms for this file may be 18 20 * found in found in the file LICENSE in this distribution or at 19 * http://www. OARcorp.com/rtems/license.html.21 * http://www.rtems.com/license/LICENSE. 20 22 * 21 * raw_exception.c,v 1.5 2002/11/04 14:29:02 joel Exp23 * $Id$ 22 24 */ 23 25 … … 30 32 #include <string.h> 31 33 32 void * codemove(void *, const void *, unsigned int, unsigned long);33 34 34 static rtems_raw_except_connect_data* raw_except_table; 35 35 static rtems_raw_except_connect_data default_raw_except_entry; 36 36 static rtems_raw_except_global_settings* local_settings; 37 37 38 int mpc565_vector_is_valid(rtems_vector vector)39 {40 switch(vector) {41 case ASM_RESET_VECTOR: /* fall through */42 case ASM_MACH_VECTOR:43 case ASM_PROT_VECTOR:44 case ASM_ISI_VECTOR:45 case ASM_EXT_VECTOR:46 case ASM_ALIGN_VECTOR:47 case ASM_PROG_VECTOR:48 case ASM_FLOAT_VECTOR:49 case ASM_DEC_VECTOR:50 51 case ASM_SYS_VECTOR:52 case ASM_TRACE_VECTOR:53 case ASM_FLOATASSIST_VECTOR:54 55 case ASM_SOFTEMUL_VECTOR:56 57 case ASM_ITLBERROR_VECTOR:58 case ASM_DTLBERROR_VECTOR:59 60 case ASM_DBREAK_VECTOR:61 case ASM_IBREAK_VECTOR:62 case ASM_PERIFBREAK_VECTOR:63 case ASM_DEVPORT_VECTOR:64 return 1;65 default: return 0;66 }67 }68 69 38 int mpc5xx_vector_is_valid(rtems_vector vector) 70 39 { 71 switch (current_ppc_cpu) { 72 case MPC_5XX: 73 if (!mpc565_vector_is_valid(vector)) { 74 return 0; 75 } 76 break; 77 default: 78 printk("Please complete libcpu/powerpc/mpc5xx/exceptions/raw_exception.c\n"); 79 printk("current_ppc_cpu = %x\n", current_ppc_cpu); 80 return 0; 81 } 82 return 1; 40 switch (current_ppc_cpu) { 41 case PPC_5XX: 42 switch(vector) { 43 case ASM_RESET_VECTOR: 44 case ASM_MACH_VECTOR: 45 46 case ASM_EXT_VECTOR: 47 case ASM_ALIGN_VECTOR: 48 case ASM_PROG_VECTOR: 49 case ASM_FLOAT_VECTOR: 50 case ASM_DEC_VECTOR: 51 52 case ASM_SYS_VECTOR: 53 case ASM_TRACE_VECTOR: 54 case ASM_FLOATASSIST_VECTOR: 55 56 case ASM_SOFTEMUL_VECTOR: 57 58 case ASM_IPROT_VECTOR: 59 case ASM_DPROT_VECTOR: 60 61 case ASM_DBREAK_VECTOR: 62 case ASM_IBREAK_VECTOR: 63 case ASM_MEBREAK_VECTOR: 64 case ASM_NMEBREAK_VECTOR: 65 return 1; 66 default: 67 return 0; 68 } 69 default: 70 printk("Please complete libcpu/powerpc/mpc5xx/exceptions/raw_exception.c\n"); 71 printk("current_ppc_cpu = %x\n", current_ppc_cpu); 72 return 0; 73 } 83 74 } 84 75 85 76 int mpc5xx_set_exception (const rtems_raw_except_connect_data* except) 86 77 { 87 78 unsigned int level; 88 79 89 if (!mpc5xx_vector_is_valid(except->exceptIndex)) { 90 return 0; 91 } 92 /* 93 * Check if default handler is actually connected. If not issue an error. 94 * You must first get the current handler via mpc5xx_get_current_exception 95 * and then disconnect it using mpc5xx_delete_exception. 96 * RATIONALE : to always have the same transition by forcing the user 97 * to get the previous handler before accepting to disconnect. 98 */ 99 if (memcmp(mpc5xx_get_vector_addr(except->exceptIndex), (void*)default_raw_except_entry.hdl.raw_hdl,default_raw_except_entry.hdl.raw_hdl_size)) { 100 return 0; 101 } 80 if (!mpc5xx_vector_is_valid(except->exceptIndex)) { 81 return 0; 82 } 83 /* 84 * Check if default handler is actually connected. If not issue an error. 85 * You must first get the current handler via mpc5xx_get_current_exception 86 * and then disconnect it using mpc5xx_delete_exception. 87 * RATIONALE : to always have the same transition by forcing the user 88 * to get the previous handler before accepting to disconnect. 89 */ 90 if (exception_handler_table[except->exceptIndex] != 91 default_raw_except_entry.hdl.raw_hdl) { 92 return 0; 93 } 102 94 103 _CPU_ISR_Disable(level); 104 105 raw_except_table [except->exceptIndex] = *except; 106 codemove((void*)mpc5xx_get_vector_addr(except->exceptIndex), 107 except->hdl.raw_hdl, 108 except->hdl.raw_hdl_size, 109 PPC_CACHE_ALIGNMENT); 110 except->on(except); 111 112 _CPU_ISR_Enable(level); 113 return 1; 95 _CPU_ISR_Disable(level); 96 97 raw_except_table[except->exceptIndex] = *except; 98 99 exception_handler_table[except->exceptIndex] = except->hdl.raw_hdl; 100 except->on(except); 101 102 _CPU_ISR_Enable(level); 103 return 1; 114 104 } 115 105 … … 120 110 } 121 111 122 *except = raw_except_table 112 *except = raw_except_table[except->exceptIndex]; 123 113 124 114 return 1; … … 139 129 * to get the previous handler before accepting to disconnect. 140 130 */ 141 if (memcmp(mpc5xx_get_vector_addr(except->exceptIndex), 142 (void*)except->hdl.raw_hdl, 143 except->hdl.raw_hdl_size)) { 144 return 0; 131 if (exception_handler_table[except->exceptIndex] != except->hdl.raw_hdl) { 132 return 0; 145 133 } 134 146 135 _CPU_ISR_Disable(level); 147 136 148 137 except->off(except); 149 codemove((void*)mpc5xx_get_vector_addr(except->exceptIndex), 150 default_raw_except_entry.hdl.raw_hdl, 151 default_raw_except_entry.hdl.raw_hdl_size, 152 PPC_CACHE_ALIGNMENT); 153 154 138 exception_handler_table[except->exceptIndex] = 139 default_raw_except_entry.hdl.raw_hdl; 140 155 141 raw_except_table[except->exceptIndex] = default_raw_except_entry; 156 142 raw_except_table[except->exceptIndex].exceptIndex = except->exceptIndex; … … 163 149 /* 164 150 * Exception global init. 151 * 152 * Install exception handler pointers from the raw exception table into the 153 * exception handler table. 165 154 */ 166 155 int mpc5xx_init_exceptions (rtems_raw_except_global_settings* config) 167 156 { 168 169 170 171 172 173 174 175 176 157 unsigned i; 158 unsigned int level; 159 160 /* 161 * store various accelerators 162 */ 163 raw_except_table = config->rawExceptHdlTbl; 164 local_settings = config; 165 default_raw_except_entry = config->defaultRawEntry; 177 166 178 167 _CPU_ISR_Disable(level); 179 168 180 for (i=0; i <= LAST_VALID_EXC; i++) { 181 if (!mpc5xx_vector_is_valid(i)){ 182 continue; 183 } 184 codemove((void*)mpc5xx_get_vector_addr(i), 185 raw_except_table[i].hdl.raw_hdl, 186 raw_except_table[i].hdl.raw_hdl_size, 187 PPC_CACHE_ALIGNMENT); 188 if (raw_except_table[i].hdl.raw_hdl != default_raw_except_entry.hdl.raw_hdl) { 189 raw_except_table[i].on(&raw_except_table[i]); 190 } 191 else { 192 raw_except_table[i].off(&raw_except_table[i]); 193 } 169 for (i = 0; i < NUM_EXCEPTIONS; i++) { 170 exception_handler_table[i] = raw_except_table[i].hdl.raw_hdl; 171 172 if (raw_except_table[i].hdl.raw_hdl != default_raw_except_entry.hdl.raw_hdl) { 173 raw_except_table[i].on(&raw_except_table[i]); 194 174 } 195 _CPU_ISR_Enable(level); 175 else { 176 raw_except_table[i].off(&raw_except_table[i]); 177 } 178 } 179 _CPU_ISR_Enable(level); 196 180 197 181 return 1; 198 182 } 199 183 -
c/src/lib/libcpu/powerpc/mpc5xx/exceptions/raw_exception.h
rdb87589 r8430205 3 3 * 4 4 * This file contains implementation of C function to 5 * Instan ciate 8xx ppcprimary exception entries.6 * More detailled information can be found on motorola7 * site and more precisely in the following book 5 * Instantiate mpc5xx primary exception entries. 6 * More detailled information can be found on the Motorola 7 * site and more precisely in the following book: 8 8 * 9 * MPC860 10 * Risc Microporcessor User's Manual 11 * Motorola REF : MPC860UM/AD 07/98 Rev .1 9 * MPC555/MPC556 User's Manual 10 * Motorola REF : MPC555UM/D Rev. 3, 2000 October 15 12 11 * 13 * Copyright (C) 1999 Eric Valette (valette@crf.canon.fr) 12 * 13 * MPC5xx port sponsored by Defence Research and Development Canada - Suffield 14 * Copyright (C) 2004, Real-Time Systems Inc. (querbach@realtime.bc.ca) 15 * 16 * Derived from libcpu/powerpc/mpc8xx/exceptions/raw_exception.h: 17 * 18 * Copyright (C) 1999 Eric Valette (valette@crf.canon.fr) 14 19 * Canon Centre Recherche France. 15 *16 * Changes for MPC5XX Wilfried Busalski (w.busalski@lancier-monitoring.de)17 * Copyright (C) 2003 Lancier Monitoring GmbH18 19 20 * 20 21 * The license and distribution terms for this file may be 21 22 * found in found in the file LICENSE in this distribution or at 22 * http://www. OARcorp.com/rtems/license.html.23 * http://www.rtems.com/license/LICENSE. 23 24 * 24 * raw_exception.h,v 1.1 2001/04/06 15:54:18 joel Exp25 * $Id$ 25 26 */ 26 27 … … 28 29 #define _LIBCPU_MPC5XX_EXCEPTION_RAW_EXCEPTION_H 29 30 31 #include <libcpu/vectors.h> 32 30 33 /* 31 * Exception Vectors as defined in the M CP750 manual34 * Exception Vectors as defined in the MPC555 User's Manual 32 35 */ 33 36 34 #define ASM_RESET_VECTOR 0x01 35 #define ASM_MACH_VECTOR 0x02 36 #define ASM_PROT_VECTOR 0x03 37 #define ASM_ISI_VECTOR 0x04 38 #define ASM_EXT_VECTOR 0x05 39 #define ASM_ALIGN_VECTOR 0x06 40 #define ASM_PROG_VECTOR 0x07 41 #define ASM_FLOAT_VECTOR 0x08 42 #define ASM_DEC_VECTOR 0x09 37 #define ASM_RESET_VECTOR 0x01 38 #define ASM_MACH_VECTOR 0x02 43 39 44 #define ASM_SYS_VECTOR 0x0C 45 #define ASM_TRACE_VECTOR 0x0D 40 #define ASM_EXT_VECTOR 0x05 41 #define ASM_ALIGN_VECTOR 0x06 42 #define ASM_PROG_VECTOR 0x07 43 #define ASM_FLOAT_VECTOR 0x08 44 #define ASM_DEC_VECTOR 0x09 45 46 #define ASM_SYS_VECTOR 0x0C 47 #define ASM_TRACE_VECTOR 0x0D 46 48 #define ASM_FLOATASSIST_VECTOR 0x0E 47 49 48 #define ASM_SOFTEMUL_VECTOR 50 #define ASM_SOFTEMUL_VECTOR 0x10 49 51 50 #define ASM_I TLBERROR_VECTOR 0x1351 #define ASM_D TLBERROR_VECTOR 0x1452 #define ASM_IPROT_VECTOR 0x13 53 #define ASM_DPROT_VECTOR 0x14 52 54 53 #define ASM_DBREAK_VECTOR 54 #define ASM_IBREAK_VECTOR 55 #define ASM_ PERIFBREAK_VECTOR 0x1E56 #define ASM_ DEVPORT_VECTOR0x1F55 #define ASM_DBREAK_VECTOR 0x1C 56 #define ASM_IBREAK_VECTOR 0x1D 57 #define ASM_MEBREAK_VECTOR 0x1E 58 #define ASM_NMEBREAK_VECTOR 0x1F 57 59 58 #define LAST_VALID_EXC ASM_DEVPORT_VECTOR 59 60 /* 61 * Vector offsets as defined in the MPC860 manual 62 */ 63 64 #define ASM_RESET_VECTOR_OFFSET (ASM_RESET_VECTOR << 8) 65 #define ASM_MACH_VECTOR_OFFSET (ASM_MACH_VECTOR << 8) 66 #define ASM_PROT_VECTOR_OFFSET (ASM_PROT_VECTOR << 8) 67 #define ASM_ISI_VECTOR_OFFSET (ASM_ISI_VECTOR << 8) 68 #define ASM_EXT_VECTOR_OFFSET (ASM_EXT_VECTOR << 8) 69 #define ASM_ALIGN_VECTOR_OFFSET (ASM_ALIGN_VECTOR << 8) 70 #define ASM_PROG_VECTOR_OFFSET (ASM_PROG_VECTOR << 8) 71 #define ASM_FLOAT_VECTOR_OFFSET (ASM_FLOAT_VECTOR << 8) 72 #define ASM_DEC_VECTOR_OFFSET (ASM_DEC_VECTOR << 8) 73 74 #define ASM_SYS_VECTOR_OFFSET (ASM_SYS_VECTOR << 8) 75 #define ASM_TRACE_VECTOR_OFFSET (ASM_TRACE_VECTOR << 8) 76 #define ASM_FLOATASSIST_VECTOR_OFFSET (ASM_FLOATASSIST_VECTOR << 8) 77 78 #define ASM_SOFTEMUL_VECTOR_OFFSET (ASM_SOFTEMUL_VECTOR << 8) 79 80 #define ASM_ITLBERROR_VECTOR_OFFSET (ASM_ITLBERROR_VECTOR << 8) 81 #define ASM_DTLBERROR_VECTOR_OFFSET (ASM_DTLBERROR_VECTOR << 8) 82 83 #define ASM_DBREAK_VECTOR_OFFSET (ASM_DBREAK_VECTOR << 8) 84 #define ASM_IBREAK_VECTOR_OFFSET (ASM_IBREAK_VECTOR << 8) 85 #define ASM_PERIFBREAK_VECTOR_OFFSET (ASM_PERIFBREAK_VECTOR << 8) 86 #define ASM_DEVPORT_VECTOR_OFFSET (ASM_DEVPORT_VECTOR_OFFSET << 8) 60 #define LAST_VALID_EXC ASM_NMEBREAK_VECTOR 87 61 88 62 #ifndef ASM … … 94 68 typedef unsigned char rtems_vector; 95 69 struct __rtems_raw_except_connect_data__; 96 typedef void (*rtems_raw_except_func) (void);97 70 typedef unsigned char rtems_raw_except_hdl_size; 98 71 99 72 typedef struct { 100 73 rtems_vector vector; 101 rtems_raw_except_func raw_hdl; 102 rtems_raw_except_hdl_size raw_hdl_size; 74 rtems_exception_handler_t* raw_hdl; 103 75 }rtems_raw_except_hdl; 104 76 … … 187 159 # endif /* ASM */ 188 160 161 #define SIZEOF_ 162 189 163 #endif 190 164 -
c/src/lib/libcpu/powerpc/mpc5xx/timer/timer.c
rdb87589 r8430205 1 1 /* timer.c 2 2 * 3 * This file manages the benchmark timer used by the RTEMS Timing Test4 * Suite. Each measured time period is demarcated by calls to5 * Timer_initialize() and Read_timer(). Read_timer() usually returns6 * the number of microseconds since Timer_initialize() exitted.3 * This file manages the interval timer on the PowerPC MPC5xx. 4 * NOTE: This is not the PIT, but rather the RTEMS interval 5 * timer 6 * We shall use the bottom 32 bits of the timebase register, 7 7 * 8 * The following was in the 403 version of this file. I don't 9 * know what it means. JTM 5/19/98 8 10 * NOTE: It is important that the timer start/stop overhead be 9 11 * determined when porting or modifying this code. 10 12 * 11 * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. 13 * 14 * MPC5xx port sponsored by Defence Research and Development Canada - Suffield 15 * Copyright (C) 2004, Real-Time Systems Inc. (querbach@realtime.bc.ca) 16 * 17 * Derived from c/src/lib/libcpu/powerpc/mpc8xx/timer/timer.c: 18 * 19 * Author: Jay Monkman (jmonkman@frasca.com) 20 * Copywright (C) 1998 by Frasca International, Inc. 21 * 22 * Derived from c/src/lib/libcpu/ppc/ppc403/timer/timer.c: 23 * 24 * Author: Andrew Bray <andy@i-cubed.co.uk> 25 * 26 * COPYRIGHT (c) 1995 by i-cubed ltd. 27 * 28 * To anyone who acknowledges that this file is provided "AS IS" 29 * without any express or implied warranty: 30 * permission to use, copy, modify, and distribute this file 31 * for any purpose is hereby granted without fee, provided that 32 * the above copyright notice and this notice appears in all 33 * copies, and that the name of i-cubed limited not be used in 34 * advertising or publicity pertaining to distribution of the 35 * software without specific, written prior permission. 36 * i-cubed limited makes no representations about the suitability 37 * of this software for any purpose. 38 * 39 * Derived from c/src/lib/libcpu/hppa1_1/timer/timer.c: 40 * 41 * COPYRIGHT (c) 1989-1998. 12 42 * On-Line Applications Research Corporation (OAR). 13 * All rights assigned to U.S. Government, 1994.14 43 * 15 * Th is material may be reproduced by or for the U.S. Government pursuant16 * to the copyright license under the clause at DFARS 252.227-7013. This17 * notice must appear in all copies of this file and its derivatives.44 * The license and distribution terms for this file may be 45 * found in the file LICENSE in this distribution or at 46 * http://www.rtems.com/license/LICENSE. 18 47 * 19 * timer.c,v 1.2 1995/05/31 16:56:39 joel Exp48 * $Id$ 20 49 */ 21 50 22 51 #include <rtems.h> 52 #include <mpc5xx.h> 23 53 24 rtems_boolean Timer_driver_Find_average_overhead; 54 static volatile rtems_unsigned32 Timer_starting; 55 static rtems_boolean Timer_driver_Find_average_overhead; 25 56 26 static unsigned int volatile lastInitValue; 57 /* 58 * This is so small that this code will be reproduced where needed. 59 */ 60 static inline rtems_unsigned32 get_itimer(void) 61 { 62 rtems_unsigned32 ret; 27 63 28 void Timer_initialize( void ) 29 { 30 asm volatile( " mftb %0": "=r" (lastInitValue) );64 asm volatile ("mftb %0" : "=r" ((ret))); /* TBLO */ 65 66 return ret; 31 67 } 32 68 33 /* 34 * The following controls the behavior of Read_timer(). 35 * 36 * AVG_OVEREHAD is the overhead for starting and stopping the timer. It 37 * is usually deducted from the number returned. 38 * 39 * LEAST_VALID is the lowest number this routine should trust. Numbers 40 * below this are "noise" and zero is returned. 41 */ 42 43 #define AVG_OVERHEAD 0 /* It typically takes X.X microseconds */ 44 /* (Y countdowns) to start/stop the timer. */ 45 /* This value is in microseconds. */ 46 #define LEAST_VALID 1 /* Don't trust a clicks value lower than this */ 47 48 int Read_timer( void ) 69 void Timer_initialize(void) 49 70 { 50 uint32_t value; 51 asm volatile ( " mftb %0": "=r" (value) ); 52 return value - lastInitValue; 71 /* set interrupt level and enable timebase. This should never */ 72 /* generate an interrupt however. */ 73 usiu.tbscrk = USIU_UNLOCK_KEY; 74 usiu.tbscr |= USIU_TBSCR_TBIRQ(4) /* interrupt priority level */ 75 | USIU_TBSCR_TBF /* freeze timebase during debug */ 76 | USIU_TBSCR_TBE; /* enable timebase */ 77 usiu.tbscrk = 0; 78 79 Timer_starting = get_itimer(); 53 80 } 54 81 55 /* 56 * Empty function call used in loops to measure basic cost of looping 57 * in Timing Test Suite. 58 */ 82 #ifndef rtems_cpu_configuration_get_timer_least_valid 83 #define rtems_cpu_configuration_get_timer_least_valid() 0 84 #endif 59 85 60 rtems_status_code Empty_function( void ) 86 #ifndef rtems_cpu_configuration_get_timer_average_overhead 87 #define rtems_cpu_configuration_get_timer_average_overhead() 0 88 #endif 89 90 int Read_timer(void) 91 { 92 rtems_unsigned32 clicks; 93 rtems_unsigned32 total; 94 95 clicks = get_itimer(); 96 97 total = clicks - Timer_starting; 98 99 if ( Timer_driver_Find_average_overhead == 1 ) 100 return total; /* in XXX microsecond units */ 101 102 else { 103 if ( total < rtems_cpu_configuration_get_timer_least_valid() ) { 104 return 0; /* below timer resolution */ 105 } 106 return (total - rtems_cpu_configuration_get_timer_average_overhead()); 107 } 108 } 109 110 rtems_status_code Empty_function(void) 61 111 { 62 112 return RTEMS_SUCCESSFUL; 63 113 } 64 114 65 void Set_find_average_overhead( 66 rtems_boolean find_flag 67 ) 115 void Set_find_average_overhead(rtems_boolean find_flag) 68 116 { 69 117 Timer_driver_Find_average_overhead = find_flag; -
c/src/lib/libcpu/powerpc/shared/include/cpuIdent.h
rdb87589 r8430205 22 22 PPC_601 = 0x1, 23 23 PPC_5XX = 0x2, 24 PPC_509 = PPC_5XX,25 PPC_533 = PPC_5XX,26 PPC_534 = PPC_5XX,27 PPC_535 = PPC_5XX,28 PPC_536 = PPC_5XX,29 PPC_555 = PPC_5XX,30 PPC_556 = PPC_5XX,31 PPC_561 = PPC_5XX,32 PPC_562 = PPC_5XX,33 PPC_563 = PPC_5XX,34 PPC_564 = PPC_5XX,35 PPC_565 = PPC_5XX,36 PPC_566 = PPC_5XX,37 MPC_5XX = PPC_5XX,38 24 PPC_603 = 0x3, 39 25 PPC_604 = 0x4,
Note: See TracChangeset
for help on using the changeset viewer.