Changeset ba46ffa6 in rtems
- Timestamp:
- 06/14/99 16:51:13 (24 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- a4f6b02
- Parents:
- 255b293
- Files:
-
- 139 added
- 2 deleted
- 10 edited
- 11 moved
Legend:
- Unmodified
- Added
- Removed
-
c/src/exec/score/cpu/powerpc/Makefile.in
r255b293 rba46ffa6 1 1 # 2 # $Id$ 3 # 4 # 2 5 # $Id$ 3 6 # … … 19 22 include $(RTEMS_ROOT)/make/directory.cfg 20 23 21 S UB_DIRS = rtems wrap24 SHARED_LIB=shared 22 25 23 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 24 cd $(top_builddir) \ 25 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status 26 ifeq ($(RTEMS_CPU_MODEL),mpc750) 27 CPUDIR=mpc750 28 else 29 CPUDIR=other_cpu 30 endif 31 32 SUB_DIRS=$(CPUDIR) $(SHARED_LIB) 33 -
c/src/exec/score/cpu/powerpc/mpc750/cpu.h
r255b293 rba46ffa6 25 25 * Copyright assigned to U.S. Government, 1994. 26 26 * 27 * The license and distribution terms for this file may in27 * The license and distribution terms for this file may be found in 28 28 * the file LICENSE in this distribution or at 29 29 * http://www.OARcorp.com/rtems/license.html. … … 40 40 41 41 #include <rtems/score/ppc.h> /* pick up machine definitions */ 42 #include <libcpu/cpu.h> 43 42 44 #ifndef ASM 43 struct CPU_Interrupt_frame;44 45 45 #include <rtems/score/ppctypes.h> 46 46 #endif … … 111 111 */ 112 112 113 #define CPU_HAS_SOFTWARE_INTERRUPT_STACK FALSE113 #define CPU_HAS_SOFTWARE_INTERRUPT_STACK TRUE 114 114 115 115 /* … … 128 128 */ 129 129 130 /* 131 * ACB: This is a lie, but it gets us a handle on a call to set up 132 * a variable derived from the top of the interrupt stack. 133 */ 134 135 #define CPU_HAS_HARDWARE_INTERRUPT_STACK TRUE 130 #define CPU_HAS_HARDWARE_INTERRUPT_STACK FALSE 136 131 137 132 /* … … 145 140 */ 146 141 147 #define CPU_ALLOCATE_INTERRUPT_STACK TRUE142 #define CPU_ALLOCATE_INTERRUPT_STACK FALSE 148 143 149 144 /* … … 153 148 */ 154 149 155 #define CPU_ISR_PASSES_FRAME_POINTER 1150 #define CPU_ISR_PASSES_FRAME_POINTER 0 156 151 157 152 /* … … 305 300 #define CPU_LITTLE_ENDIAN FALSE 306 301 307 /*308 * The following defines the number of bits actually used in the309 * interrupt field of the task mode. How those bits map to the310 * CPU interrupt levels is defined by the routine _CPU_ISR_Set_level().311 *312 * The interrupt level is bit mapped for the PowerPC family. The313 * bits are set to 0 to indicate that a particular exception source314 * enabled and 1 if it is disabled. This keeps with RTEMS convention315 * that interrupt level 0 means all sources are enabled.316 *317 * The bits are assigned to correspond to enable bits in the MSR.318 */319 320 #define PPC_INTERRUPT_LEVEL_ME 0x01321 #define PPC_INTERRUPT_LEVEL_EE 0x02322 #define PPC_INTERRUPT_LEVEL_CE 0x04323 324 /* XXX should these be maskable? */325 #if 0326 #define PPC_INTERRUPT_LEVEL_DE 0x08327 #define PPC_INTERRUPT_LEVEL_BE 0x10328 #define PPC_INTERRUPT_LEVEL_SE 0x20329 #endif330 331 #define CPU_MODES_INTERRUPT_MASK 0x00000007332 302 333 303 /* … … 420 390 typedef struct CPU_Interrupt_frame { 421 391 unsigned32 stacklink; /* Ensure this is a real frame (also reg1 save) */ 422 #if (PPC_ABI == PPC_ABI_POWEROPEN || PPC_ABI == PPC_ABI_GCC27) 423 unsigned32 dummy[13]; /* Used by callees: PowerOpen ABI */ 424 #else 425 unsigned32 dummy[1]; /* Used by callees: SVR4/EABI */ 426 #endif 427 /* This is what is left out of the primary contexts */ 392 unsigned32 calleeLr; /* link register used by callees: SVR4/EABI */ 393 /* This is what is left out of the primary contexts */ 428 394 unsigned32 gpr0; 429 395 unsigned32 gpr2; /* play safe */ … … 451 417 unsigned32 pad[3]; 452 418 } CPU_Interrupt_frame; 453 454 419 455 420 /* 456 421 * The following table contains the information required to configure … … 472 437 473 438 unsigned32 clicks_per_usec; /* Timer clicks per microsecond */ 474 void (*spurious_handler)(unsigned32 vector, CPU_Interrupt_frame *);475 439 boolean exceptions_in_RAM; /* TRUE if in RAM */ 476 440 477 #if (defined(ppc403) || defined(mpc860) || defined(mpc821))478 unsigned32 serial_per_sec; /* Serial clocks per second */479 boolean serial_external_clock;480 boolean serial_xon_xoff;481 boolean serial_cts_rts;482 unsigned32 serial_rate;483 unsigned32 timer_average_overhead; /* Average overhead of timer in ticks */484 unsigned32 timer_least_valid; /* Least valid number from timer */485 boolean timer_internal_clock; /* TRUE, when timer runs with CPU clk */486 #endif487 488 #if (defined(mpc860) || defined(mpc821))489 unsigned32 clock_speed; /* Speed of CPU in Hz */490 #endif491 441 } rtems_cpu_table; 492 493 /*494 * The following type defines an entry in the PPC's trap table.495 *496 * NOTE: The instructions chosen are RTEMS dependent although one is497 * obligated to use two of the four instructions to perform a498 * long jump. The other instructions load one register with the499 * trap type (a.k.a. vector) and another with the psr.500 */501 502 typedef struct {503 unsigned32 stwu_r1; /* stwu %r1, -(??+IP_END)(%1)*/504 unsigned32 stw_r0; /* stw %r0, IP_0(%r1) */505 unsigned32 li_r0_IRQ; /* li %r0, _IRQ */506 unsigned32 b_Handler; /* b PROC (_ISR_Handler) */507 } CPU_Trap_table_entry;508 442 509 443 /* … … 533 467 534 468 /* 469 * This defines the number of levels and the mask used to pick those 470 * bits out of a thread mode. 471 */ 472 473 #define CPU_MODES_INTERRUPT_LEVEL 0x00000001 /* interrupt level in mode */ 474 #define CPU_MODES_INTERRUPT_MASK 0x00000001 /* interrupt level in mode */ 475 476 /* 535 477 * With some compilation systems, it is difficult if not impossible to 536 478 * call a high-level language routine from assembly language. This … … 550 492 551 493 SCORE_EXTERN struct { 552 unsigned32 *Nest_level;553 494 unsigned32 *Disable_level; 554 void *Vector_table;555 495 void *Stack; 556 #if (PPC_ABI == PPC_ABI_POWEROPEN)557 unsigned32 Dispatch_r2;558 #else559 unsigned32 Default_r2;560 #if (PPC_ABI != PPC_ABI_GCC27)561 unsigned32 Default_r13;562 #endif563 #endif564 496 volatile boolean *Switch_necessary; 565 497 boolean *Signal; 566 498 567 unsigned32 msr_initial;568 499 } _CPU_IRQ_info CPU_STRUCTURE_ALIGNMENT; 569 500 … … 663 594 #define loc_string(a,b) a " (" #b ")\n" 664 595 665 #define _CPU_MSR_Value( _msr_value ) \ 666 do { \ 667 _msr_value = 0; \ 668 asm volatile ("mfmsr %0" : "=&r" ((_msr_value)) : "0" ((_msr_value))); \ 669 } while (0) 670 671 #define _CPU_MSR_SET( _msr_value ) \ 672 { asm volatile ("mtmsr %0" : "=&r" ((_msr_value)) : "0" ((_msr_value))); } 673 674 #if 0 675 #define _CPU_ISR_Disable( _isr_cookie ) \ 676 { register unsigned int _disable_mask = PPC_MSR_DISABLE_MASK; \ 677 _isr_cookie = 0; \ 678 asm volatile ( 679 "mfmsr %0" : \ 680 "=r" ((_isr_cookie)) : \ 681 "0" ((_isr_cookie)) \ 682 ); \ 683 asm volatile ( 684 "andc %1,%0,%1" : \ 685 "=r" ((_isr_cookie)), "=&r" ((_disable_mask)) : \ 686 "0" ((_isr_cookie)), "1" ((_disable_mask)) \ 687 ); \ 688 asm volatile ( 689 "mtmsr %1" : \ 690 "=r" ((_disable_mask)) : \ 691 "0" ((_disable_mask)) \ 692 ); \ 596 597 static inline unsigned32 _CPU_ISR_Get_level( void ) 598 { 599 register unsigned int msr; 600 _CPU_MSR_GET(msr); 601 if (msr & MSR_EE) return 0; 602 else return 1; 603 } 604 605 static inline void _CPU_ISR_Set_level( unsigned32 level ) 606 { 607 register unsigned int msr; 608 _CPU_MSR_GET(msr); 609 if (!(level & CPU_MODES_INTERRUPT_MASK)) { 610 msr |= MSR_EE; 693 611 } 694 #endif 695 696 #define _CPU_ISR_Disable( _isr_cookie ) \ 697 { register unsigned int _disable_mask = PPC_MSR_DISABLE_MASK; \ 698 _isr_cookie = 0; \ 699 asm volatile ( \ 700 "mfmsr %0; andc %1,%0,%1; mtmsr %1" : \ 701 "=&r" ((_isr_cookie)), "=&r" ((_disable_mask)) : \ 702 "0" ((_isr_cookie)), "1" ((_disable_mask)) \ 703 ); \ 612 else { 613 msr &= ~MSR_EE; 704 614 } 705 706 707 #define _CPU_Data_Cache_Block_Flush( _address ) \ 708 do { register void *__address = (_address); \ 709 register unsigned32 _zero = 0; \ 710 asm volatile ( "dcbf %0,%1" : \ 711 "=r" (_zero), "=r" (__address) : \ 712 "0" (_zero), "1" (__address) \ 713 ); \ 714 } while (0) 715 716 717 /* 718 * Enable interrupts to the previous level (returned by _CPU_ISR_Disable). 719 * This indicates the end of an RTEMS critical section. The parameter 720 * _isr_cookie is not modified. 721 */ 722 723 #define _CPU_ISR_Enable( _isr_cookie ) \ 724 { \ 725 asm volatile ( "mtmsr %0" : \ 726 "=r" ((_isr_cookie)) : \ 727 "0" ((_isr_cookie))); \ 728 } 729 730 /* 731 * This temporarily restores the interrupt to _isr_cookie before immediately 732 * disabling them again. This is used to divide long RTEMS critical 733 * sections into two or more parts. The parameter _isr_cookie is not 734 * modified. 735 * 736 * NOTE: The version being used is not very optimized but it does 737 * not trip a problem in gcc where the disable mask does not 738 * get loaded. Check this for future (post 10/97 gcc versions. 739 */ 740 741 #define _CPU_ISR_Flash( _isr_cookie ) \ 742 { register unsigned int _disable_mask = PPC_MSR_DISABLE_MASK; \ 743 asm volatile ( \ 744 "mtmsr %0; andc %1,%0,%1; mtmsr %1" : \ 745 "=r" ((_isr_cookie)), "=r" ((_disable_mask)) : \ 746 "0" ((_isr_cookie)), "1" ((_disable_mask)) \ 747 ); \ 748 } 749 750 /* 751 * Map interrupt level in task mode onto the hardware that the CPU 752 * actually provides. Currently, interrupt levels which do not 753 * map onto the CPU in a generic fashion are undefined. Someday, 754 * it would be nice if these were "mapped" by the application 755 * via a callout. For example, m68k has 8 levels 0 - 7, levels 756 * 8 - 255 would be available for bsp/application specific meaning. 757 * This could be used to manage a programmable interrupt controller 758 * via the rtems_task_mode directive. 759 */ 760 761 unsigned32 _CPU_ISR_Calculate_level( 762 unsigned32 new_level 763 ); 764 765 void _CPU_ISR_Set_level( 766 unsigned32 new_level 767 ); 615 _CPU_MSR_SET(msr); 616 } 768 617 769 unsigned32 _CPU_ISR_Get_level( void ); 770 771 void _CPU_ISR_install_raw_handler( 772 unsigned32 vector, 773 proc_ptr new_handler, 774 proc_ptr *old_handler 775 ); 776 777 /* end of ISR handler macros */ 778 779 /* 780 * Simple spin delay in microsecond units for device drivers. 781 * This is very dependent on the clock speed of the target. 782 */ 783 784 #define CPU_Get_timebase_low( _value ) \ 785 asm volatile( "mftb %0" : "=r" (_value) ) 786 787 #define delay( _microseconds ) \ 788 do { \ 789 unsigned32 start, ticks, now; \ 790 CPU_Get_timebase_low( start ) ; \ 791 ticks = (_microseconds) * Cpu_table.clicks_per_usec; \ 792 do \ 793 CPU_Get_timebase_low( now ) ; \ 794 while (now - start < ticks); \ 795 } while (0) 796 797 #define delay_in_bus_cycles( _cycles ) \ 798 do { \ 799 unsigned32 start, now; \ 800 CPU_Get_timebase_low( start ); \ 801 do \ 802 CPU_Get_timebase_low( now ); \ 803 while (now - start < (_cycles)); \ 804 } while (0) 805 806 618 #define _CPU_ISR_install_vector(irq, new, old) {BSP_panic("_CPU_ISR_install_vector called\n");} 807 619 808 620 /* Context handler macros */ … … 893 705 894 706 #define _CPU_Fatal_halt( _error ) \ 895 _ CPU_Fatal_error(_error)707 _BSP_Fatal_error(_error) 896 708 897 709 /* end of Fatal Error manager macros */ … … 1000 812 ); 1001 813 1002 /*1003 * _CPU_ISR_install_vector1004 *1005 * This routine installs an interrupt vector.1006 */1007 1008 void _CPU_ISR_install_vector(1009 unsigned32 vector,1010 proc_ptr new_handler,1011 proc_ptr *old_handler1012 );1013 814 1014 815 /* -
c/src/exec/score/cpu/powerpc/other_cpu/cpu.h
r255b293 rba46ffa6 42 42 #ifndef ASM 43 43 struct CPU_Interrupt_frame; 44 typedef void ( *ppc_isr_entry )( int, struct CPU_Interrupt_frame * ); 44 45 45 46 #include <rtems/score/ppctypes.h> -
c/src/exec/score/include/rtems/score/isr.h
r255b293 rba46ffa6 83 83 */ 84 84 85 SCORE_EXTERN unsigned32 _ISR_Nest_level;85 SCORE_EXTERN volatile unsigned32 _ISR_Nest_level; 86 86 87 87 /* -
c/src/exec/score/include/rtems/score/thread.h
r255b293 rba46ffa6 235 235 */ 236 236 237 SCORE_EXTERN unsigned32 _Thread_Dispatch_disable_level;237 SCORE_EXTERN volatile unsigned32 _Thread_Dispatch_disable_level; 238 238 239 239 /* -
c/src/exec/score/inline/rtems/score/isr.inl
r255b293 rba46ffa6 30 30 */ 31 31 32 #if defined(powerpc) 33 #define CPU_PROVIDES_ISR_IS_IN_PROGRESS 34 #endif 35 36 #ifndef CPU_PROVIDES_ISR_IS_IN_PROGRESS 37 32 38 RTEMS_INLINE_ROUTINE boolean _ISR_Is_in_progress( void ) 33 39 { 34 40 return (_ISR_Nest_level != 0); 35 41 } 42 #else 43 #include <rtems/score/c_isr.inl> 44 #endif 36 45 37 46 /*PAGE -
c/src/lib/libbsp/i386/shared/irq/irq.c
r255b293 rba46ffa6 347 347 } 348 348 /* 349 * must disable slave pic anyway349 * must enable slave pic anyway 350 350 */ 351 351 BSP_irq_enable_at_i8259s (2); … … 375 375 /* 376 376 * I plan to process other thread related events here. 377 * This will include DEBUG session requ sted from keyboard...377 * This will include DEBUG session requested from keyboard... 378 378 */ 379 379 } -
c/src/lib/libbsp/i386/shared/irq/irq_init.c
r255b293 rba46ffa6 94 94 * The second entry has a priority of 255 because 95 95 * it is the slave pic entry and is should always remain 96 * un amsked.96 * unmasked. 97 97 */ 98 98 0,0, -
c/src/lib/libbsp/powerpc/motorola_powerpc/start/Makefile.in
r255b293 rba46ffa6 6 6 srcdir = @srcdir@ 7 7 top_srcdir = @top_srcdir@ 8 top_builddir = ../../../../../../.. /..9 subdir = c/src/ exec/score/cpu/powerpc/rtems/score8 top_builddir = ../../../../../../.. 9 subdir = c/src/lib/libbsp/powerpc/mcp750/start 10 10 11 11 INSTALL = @INSTALL@ … … 16 16 VPATH = @srcdir@ 17 17 18 PGM=${ARCH}/start.o 19 18 20 # C source names, if any, go here -- minus the .c 19 21 C_PIECES= … … 21 23 C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) 22 24 23 H_PIECES=cpu.h ppc.h ppctypes.h 24 H_FILES=$(H_PIECES:%=$(srcdir)/%) 25 H_FILES= 25 26 26 27 # Assembly source names, if any, go here -- minus the .S 27 S_PIECES= 28 S_PIECES=start 28 29 S_FILES=$(S_PIECES:%=%.S) 29 30 S_O_FILES=$(S_FILES:%.S=${ARCH}/%.o) … … 41 42 DEFINES += 42 43 CPPFLAGS += 43 CFLAGS += 44 CFLAGS += 44 45 45 46 LD_PATHS += … … 55 56 56 57 CLEAN_ADDITIONS += 57 CLOBBER_ADDITIONS += $(BUILT_SOURCES)58 CLOBBER_ADDITIONS += 58 59 59 # Install the program(s), appending _g or _p as appropriate. 60 # for include files, just use $(INSTALL_CHANGE) 61 all: install-headers 62 63 install-headers: ${H_FILES} 64 $(INSTALL_CHANGE) -m 444 ${H_FILES} $(PROJECT_INCLUDE)/rtems/score 65 66 preinstall: install-headers 60 all: ${ARCH} $(SRCS) $(OBJS) $(PGM) 61 $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/lib 67 62 68 63 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status -
c/src/lib/libcpu/powerpc/Makefile.in
r255b293 rba46ffa6 19 19 include $(RTEMS_ROOT)/make/directory.cfg 20 20 21 SUB_DIRS=$(wildcard $(RTEMS_CPU_MODEL)) 21 ifeq ($(RTEMS_CPU_MODEL),mpc750) 22 SHARED_LIB=shared 23 endif 24 25 SUB_DIRS=$(wildcard $(RTEMS_CPU_MODEL)) $(SHARED_LIB) 22 26 23 27 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status -
c/src/lib/libcpu/powerpc/mpc750/Makefile.in
r255b293 rba46ffa6 6 6 srcdir = @srcdir@ 7 7 top_srcdir = @top_srcdir@ 8 top_builddir = ../../../../../.. /..9 subdir = c/src/ exec/score/cpu/powerpc/rtems8 top_builddir = ../../../../../.. 9 subdir = c/src/lib/libcpu/mpc750 10 10 11 11 INSTALL = @INSTALL@ … … 19 19 include $(RTEMS_ROOT)/make/directory.cfg 20 20 21 SUB_DIRS = score 21 # wrapup is the one that actually builds and installs the library 22 # from the individual .rel files built in other directories 23 SUB_DIRS=exceptions mmu clock wrapup 22 24 23 25 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status -
cpukit/score/include/rtems/score/isr.h
r255b293 rba46ffa6 83 83 */ 84 84 85 SCORE_EXTERN unsigned32 _ISR_Nest_level;85 SCORE_EXTERN volatile unsigned32 _ISR_Nest_level; 86 86 87 87 /* -
cpukit/score/include/rtems/score/thread.h
r255b293 rba46ffa6 235 235 */ 236 236 237 SCORE_EXTERN unsigned32 _Thread_Dispatch_disable_level;237 SCORE_EXTERN volatile unsigned32 _Thread_Dispatch_disable_level; 238 238 239 239 /* -
cpukit/score/inline/rtems/score/isr.inl
r255b293 rba46ffa6 30 30 */ 31 31 32 #if defined(powerpc) 33 #define CPU_PROVIDES_ISR_IS_IN_PROGRESS 34 #endif 35 36 #ifndef CPU_PROVIDES_ISR_IS_IN_PROGRESS 37 32 38 RTEMS_INLINE_ROUTINE boolean _ISR_Is_in_progress( void ) 33 39 { 34 40 return (_ISR_Nest_level != 0); 35 41 } 42 #else 43 #include <rtems/score/c_isr.inl> 44 #endif 36 45 37 46 /*PAGE
Note: See TracChangeset
for help on using the changeset viewer.