]> git.kernelconcepts.de Git - karo-tx-redboot.git/blob - packages/hal/synth/arch/v2_0/cdl/hal_synth.cdl
unified MX27, MX25, MX37 trees
[karo-tx-redboot.git] / packages / hal / synth / arch / v2_0 / cdl / hal_synth.cdl
1 # ====================================================================
2 #
3 #      hal_synth.cdl
4 #
5 #      Synthetic target architectural configuration data
6 #
7 # ====================================================================
8 #####ECOSGPLCOPYRIGHTBEGIN####
9 ## -------------------------------------------
10 ## This file is part of eCos, the Embedded Configurable Operating System.
11 ## Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
12 ##
13 ## eCos is free software; you can redistribute it and/or modify it under
14 ## the terms of the GNU General Public License as published by the Free
15 ## Software Foundation; either version 2 or (at your option) any later version.
16 ##
17 ## eCos is distributed in the hope that it will be useful, but WITHOUT ANY
18 ## WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 ## FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
20 ## for more details.
21 ##
22 ## You should have received a copy of the GNU General Public License along
23 ## with eCos; if not, write to the Free Software Foundation, Inc.,
24 ## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
25 ##
26 ## As a special exception, if other files instantiate templates or use macros
27 ## or inline functions from this file, or you compile this file and link it
28 ## with other works to produce a work based on this file, this file does not
29 ## by itself cause the resulting work to be covered by the GNU General Public
30 ## License. However the source code for this file must still be made available
31 ## in accordance with section (3) of the GNU General Public License.
32 ##
33 ## This exception does not invalidate any other reasons why a work based on
34 ## this file might be covered by the GNU General Public License.
35 ##
36 ## Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
37 ## at http://sources.redhat.com/ecos/ecos-license/
38 ## -------------------------------------------
39 #####ECOSGPLCOPYRIGHTEND####
40 # ====================================================================
41 ######DESCRIPTIONBEGIN####
42 #
43 # Author(s):      jskov
44 # Original data:  jskov
45 # Contributors:   bartv
46 # Date:           1999-11-01
47 #
48 #####DESCRIPTIONEND####
49 #
50 # ====================================================================
51
52 cdl_package CYGPKG_HAL_SYNTH {
53     display  "Linux Synthetic target"
54     parent        CYGPKG_HAL_I386
55     define_header hal_synth.h
56     include_dir   cyg/hal
57     requires      !CYGDBG_KERNEL_DEBUG_GDB_THREAD_SUPPORT
58     
59     description   "
60         The Linux Synthetic Target HAL package provides the 
61         support needed to run eCos binaries on top of a
62         Linux kernel."
63
64     implements    CYGINT_HAL_TESTS_NO_CACHES
65
66     make {
67         <PREFIX>/lib/target.ld: <PACKAGE>/src/synth.ld
68         $(CC) -E -P -Wp,-MD,target.tmp -DEXTRAS=1 -xc $(INCLUDE_PATH) $(CFLAGS) -o $@ $<
69         @echo $@ ": \\" > $(notdir $@).deps
70         @tail -n +2 target.tmp >> $(notdir $@).deps
71         @echo >> $(notdir $@).deps
72         @rm target.tmp
73     }
74     compile       synth_entry.c synth_diag.c synth_intr.c synth_syscalls.c
75
76     define_proc {
77         puts $::cdl_system_header "#define CYGBLD_HAL_TARGET_H   <pkgconf/hal_synth.h>"
78     }
79
80     # Real-time clock/counter specifics
81     cdl_component CYGNUM_HAL_RTC_CONSTANTS {
82         display       "Real-time clock constants."
83         description   "
84             In the synthetic target the system clock is implemented using
85             Linux setitimer() and a SIGALRM signal. The PERIOD value is the
86             number of microseconds between signals, the usec field of an
87             itimerval structure. It should be a multiple of 10000 because
88             Linux will not generate signals at a finer grain than that.
89             The NUMERATOR and DENOMINATOR are derived from the period."
90         flavor        none
91     
92         cdl_option CYGNUM_HAL_RTC_PERIOD {
93             display       "Real-time clock period"
94             flavor        data
95             default_value 10000
96             requires      { 0 == (CYGNUM_HAL_RTC_PERIOD % 10000) }
97             description "
98                 This option corresponds to the number of microseconds between
99                 clock interrupts."
100         }
101         cdl_option CYGNUM_HAL_RTC_NUMERATOR {
102             display       "Real-time clock numerator"
103             flavor        data
104             calculated    CYGNUM_HAL_RTC_DENOMINATOR * 1000 * CYGNUM_HAL_RTC_PERIOD
105         }
106         cdl_option CYGNUM_HAL_RTC_DENOMINATOR {
107             display       "Real-time clock denominator"
108             flavor        data
109             default_value 100
110         }
111     }
112     # What to do when idling
113     cdl_option CYGIMP_HAL_IDLE_THREAD_SPIN {
114         display "Spin when idle"
115         default_value   CYGIMP_IDLE_THREAD_YIELD
116         description "
117             By default, whenever the eCos application enters the idle thread
118             the synthetic target HAL will make a select() system call. Effectively
119             this causes the application to block until an interrupt occurs,
120             without consuming any cpu resources, as if the hardware supported
121             some sort of IDLE instruction. Usually this behaviour is desirable.
122             However it interferes with the emulation of some hardware. For
123             example the synthetic watchdog timer device can use consumed cpu time
124             rather than wallclock time to determine whether or not the watchdog
125             has triggered, and if the process is spending nearly all its time
126             blocked in select() then the watchdog will not trigger when it should.
127             There are also some kernel configurations which require that the idle
128             thread does not block."
129     }
130     requires      { CYGIMP_IDLE_THREAD_YIELD implies CYGIMP_HAL_IDLE_THREAD_SPIN }
131     
132     cdl_option CYGBLD_LINKER_SCRIPT {
133         display "Linker script"
134         flavor data
135         no_define
136         calculated  { "src/synth.ld" }
137     }
138
139     cdl_option CYGSEM_HAL_SYNTH_TESTS {
140         display       "Build the Synth HAL tests"
141         default_value 0
142         description   "
143              The only test at the moment is disabled by default
144              because it has to be run manually. It should be run both within 
145              eCos and natively on Linux and the results compared"
146     }
147
148     cdl_component CYGPKG_HAL_SYNTH_TESTS {
149         display       "Synth HAL tests"
150         active_if     CYGSEM_HAL_SYNTH_TESTS
151         flavor        data
152         no_define
153         calculated    { "tests/ftok.c" }
154         
155         make {
156             <PREFIX>/tests/ftok: <PACKAGE>/tests/ftok.c
157             @mkdir -p "$(dir $@)"
158             @$(HOST_CC) -DHOST -g -O2 -o $@ $< || cc -DHOST -g -O2 -o $@ $< || -DHOST gcc -g -O2 -o $@ $<
159         }
160     }
161 }