Changeset 7046cdd in rtems


Ignore:
Timestamp:
Oct 28, 1999, 4:01:41 PM (20 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
b502b0d1
Parents:
e90c5a1e
Message:

Patch rtems-rc-19991011-3.diff from Ralf Corsepius.

Files:
7 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/score/cpu/sh/rtems/score/sh.h

    re90c5a1e r7046cdd  
    149149#define CPU_swap_u16( value ) sh_swap_u16( value )
    150150
    151 /*
    152  *  Simple spin delay in microsecond units for device drivers.
    153  *  This is very dependent on the clock speed of the target.
    154  *
    155  *  Since we don't have a real time clock, this is a very rough
    156  *  approximation, assuming that each cycle of the delay loop takes
    157  *  approx. 4 machine cycles.
    158  *
    159  *  e.g.: MHZ = 20 =>     5e-8 secs per instruction
    160  *                 => 4 * 5e-8 secs per delay loop
    161  */
    162 
    163 #define sh_delay( microseconds ) \
    164 { register unsigned int _delay = (microseconds) * (MHZ / 4 ); \
    165   asm volatile ( \
    166 "0:     add  #-1,%0\n \
    167         nop\n \
    168         cmp/pl %0\n \
    169         bt 0b\
    170         nop" \
    171     :: "r" (_delay) );  \
    172 }
    173 
    174 #define CPU_delay( microseconds ) sh_delay( microseconds )
    175 
    176151extern unsigned int sh_set_irq_priority(
    177152  unsigned int irq,
  • c/src/lib/libbsp/sh/gensh1/include/bsp.h

    re90c5a1e r7046cdd  
    6969
    7070/* Constants */
     71#ifndef MHZ
     72#error Missing MHZ
     73#endif
    7174
    72 #define MHZ 20
     75/*
     76 *  Simple spin delay in microsecond units for device drivers.
     77 *  This is very dependent on the clock speed of the target.
     78 *
     79 *  Since we don't have a real time clock, this is a very rough
     80 *  approximation, assuming that each cycle of the delay loop takes
     81 *  approx. 4 machine cycles.
     82 *
     83 *  e.g.: MHZ = 20 =>     5e-8 secs per instruction
     84 *                 => 4 * 5e-8 secs per delay loop
     85 */
     86
     87#define delay( microseconds ) \
     88{ register unsigned int _delay = (microseconds) * (MHZ / 4 ); \
     89  asm volatile ( \
     90"0:     add  #-1,%0\n \
     91        nop\n \
     92        cmp/pl %0\n \
     93        bt 0b\
     94        nop" \
     95    :: "r" (_delay) );  \
     96}
     97
     98/*
     99 * For backward compatibility only.
     100 * Do not rely on them being present in future
     101 */
     102#define CPU_delay( microseconds ) delay( microseconds )
     103#define sh_deley( microseconds ) delay( microseconds )
    73104
    74105/*
  • c/src/lib/libbsp/sh/gensh1/startup/Makefile.in

    re90c5a1e r7046cdd  
    4848
    4949DEFINES +=
    50 CPPFLAGS +=
     50CPPFLAGS += $(BSP_CPPFLAGS)
    5151CFLAGS +=
    5252
  • c/src/lib/libcpu/sh/sh7032/clock/Makefile.in

    re90c5a1e r7046cdd  
    4141
    4242DEFINES +=
    43 CPPFLAGS +=
     43CPPFLAGS += -DMHZ=$(MHZ)
    4444CFLAGS += $(CFLAGS_OS_V)
    4545
  • c/src/lib/libcpu/sh/sh7032/timer/Makefile.in

    re90c5a1e r7046cdd  
    4141
    4242DEFINES +=
    43 CPPFLAGS +=
     43CPPFLAGS += -DMHZ=$(MHZ)
    4444CFLAGS +=
    4545
  • cpukit/score/cpu/sh/rtems/score/sh.h

    re90c5a1e r7046cdd  
    149149#define CPU_swap_u16( value ) sh_swap_u16( value )
    150150
    151 /*
    152  *  Simple spin delay in microsecond units for device drivers.
    153  *  This is very dependent on the clock speed of the target.
    154  *
    155  *  Since we don't have a real time clock, this is a very rough
    156  *  approximation, assuming that each cycle of the delay loop takes
    157  *  approx. 4 machine cycles.
    158  *
    159  *  e.g.: MHZ = 20 =>     5e-8 secs per instruction
    160  *                 => 4 * 5e-8 secs per delay loop
    161  */
    162 
    163 #define sh_delay( microseconds ) \
    164 { register unsigned int _delay = (microseconds) * (MHZ / 4 ); \
    165   asm volatile ( \
    166 "0:     add  #-1,%0\n \
    167         nop\n \
    168         cmp/pl %0\n \
    169         bt 0b\
    170         nop" \
    171     :: "r" (_delay) );  \
    172 }
    173 
    174 #define CPU_delay( microseconds ) sh_delay( microseconds )
    175 
    176151extern unsigned int sh_set_irq_priority(
    177152  unsigned int irq,
  • make/custom/gensh1.cfg

    re90c5a1e r7046cdd  
    99#
    1010
    11 MHZ:=20
     11MHZ=20
    1212
    1313include $(RTEMS_ROOT)/make/custom/default.cfg
     
    1919RTEMS_BSP_FAMILY=gensh1
    2020
     21# BSP specific preprocessor flags.
     22# These should only be used in BSP dependent directories.
     23BSP_CPPFLAGS=-DMHZ=$(MHZ)
     24
    2125#
    2226#  This contains the compiler options necessary to select the CPU model
    2327#  and (hopefully) optimize for it.
    2428#
    25 CPU_CFLAGS=-m1
     29#  HACK: We have to append BSP_CPPFLAGS to CPU_CFLAGS, because
     30#        per BSP and per CPU CPPFLAGS are not (yet?) supported
     31CPU_CFLAGS=-m1 $(BSP_CPPFLAGS)
     32# CPU_CFLAGS=-m1
    2633
    2734# debug flags: typically none, but we use -O1 as it produces better code
     
    3138# -O4 is ok for RTEMS
    3239CFLAGS_OPTIMIZE_V = -O4
     40
     41CPPFLAGS+=$(BSP_CPPFLAGS)
    3342
    3443#  This section makes the target dependent options file.
Note: See TracChangeset for help on using the changeset viewer.