OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [doc/] [itron3.0/] [gen_section] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1026 ivang
#
2
#  This shell script generates the starting template for a manager chapter.
3
#
4
 
5
 
6
# Set this based on which chapter you want to generate a template for.
7
chapter=$1
8
 
9
case ${chapter} in
10
  task)
11
    CHAPTER_CAPS="Task"
12
    CHAPTER_LOWER="task"
13
    ROUTINES=" cre_tsk del_tsk sta_tsk ext_tsk exd_tsk ter_tsk \
14
      dis_dsp ena_dsp chg_pri rot_rdq rel_wai get_tid ref_tsk"
15
    ;;
16
 
17
  tasksync)
18
    CHAPTER_CAPS="Task-Dependent Synchronization"
19
    CHAPTER_LOWER="task-dependent synchronization"
20
    ROUTINES=" sus_tsk rsm_tsk frsm_tsk \
21
      slp_tsk tslp_tsk wup_tsk can_wup"
22
    ;;
23
 
24
  semaphore)
25
    CHAPTER_CAPS="Semaphore"
26
    CHAPTER_LOWER="semaphore"
27
    ROUTINES="cre_sem del_sem sig_sem wai_sem preq_sem twai_sem ref_sem "
28
    ;;
29
 
30
  eventflags)
31
    CHAPTER_CAPS="Eventflags"
32
    CHAPTER_LOWER="eventflags"
33
    ROUTINES=" cre_flg del_flg set_flg clr_flg wai_flg pol_flg \
34
       twai_flg ref_flg "
35
    ;;
36
 
37
  mailbox)
38
    CHAPTER_CAPS="Mailbox"
39
    CHAPTER_LOWER="mailbox"
40
    ROUTINES="cre_mbx del_mbx snd_msg rcv_msg prcv_msg trcv_msg ref_mbx"
41
    ;;
42
 
43
  msgbuffer)
44
    CHAPTER_CAPS="Message Buffer"
45
    CHAPTER_LOWER="message buffer"
46
    ROUTINES=" cre_mbf del_mbf snd_mbf psnd_mbf tsnd_mbf rcv_mbf prcv_mbf \
47
      trcv_mbf ref_mbf "
48
    ;;
49
 
50
  rendezvous)
51
    CHAPTER_CAPS="Rendezvous"
52
    CHAPTER_LOWER="rendezvous"
53
    ROUTINES=" cre_por del_por cal_por pcal_por tcal_por acp_por pacp_por \
54
      tacp_por fwd_por rpl_rdv ref_por"
55
    ;;
56
 
57
  interrupt)
58
    CHAPTER_CAPS="Interrupt"
59
    CHAPTER_LOWER="interrupt"
60
    ROUTINES=" def_int ret_int ret_wup loc_cpu unl_cpu dis_int ena_int
61
      chg_iXX ref_iXX"
62
    ;;
63
 
64
  memorypool)
65
    CHAPTER_CAPS="Memory Pool"
66
    CHAPTER_LOWER="memory pool"
67
    ROUTINES=" cre_mpl del_mpl get_blk pget_blk tget_blk rel_blk ref_mpl"
68
    ;;
69
 
70
  fixedblock)
71
    CHAPTER_CAPS="Fixed Block"
72
    CHAPTER_LOWER="fixed block"
73
    ROUTINES=" cre_mpf del_mpf get_blf pget_blf tget_blf rel_blf ref_mpf"
74
    ;;
75
 
76
 
77
  time)
78
    CHAPTER_CAPS="Time"
79
    CHAPTER_LOWER="time"
80
    ROUTINES=" get_tim set_tim dly_tsk \
81
       def_cyc act_cyc ref_cyc \
82
       def_alm ref_alm ret_tmr"
83
    ;;
84
 
85
  config)
86
    CHAPTER_CAPS="System"
87
    CHAPTER_LOWER="system"
88
    ROUTINES=" get_ver ref_sys ref_cfg def_svc def_exc"
89
    ;;
90
 
91
  network)
92
    CHAPTER_CAPS="Network Support"
93
    CHAPTER_LOWER="network support"
94
    ROUTINES=" nrea_dat nwri_dat nget_nod nget_ver"
95
    ;;
96
  psxtimer)
97
    CHAPTER_CAPS="Timer"
98
    CHAPTER_LOWER="timer"
99
    ROUTINES="timer_create timer_delete timer_settime timer_gettime timer_getoverrun"
100
    ;;
101
  *)
102
    echo "Unknown chapter name"
103
    exit 1
104
    ;;
105
esac
106
 
107
if [ "x${CHAPTER_CAPS}" = "x" -o "x${CHAPTER_LOWER}" = "x" \
108
     -o "x${ROUTINES}" = "x" ] ; then
109
  echo "initialization problem"
110
  exit 1
111
fi
112
 
113
echo "@c"
114
echo "@c  This is the chapter from the RTEMS ITRON User's Guide that"
115
echo "@c  documents the services provided by the ${CHAPTER_LOWER}"
116
echo "@c  manager."
117
echo "@c"
118
echo "@c  \$Id\$"
119
echo "@c"
120
echo ""
121
echo "@chapter ${CHAPTER_CAPS}" Manager
122
echo ""
123
echo "@section Introduction"
124
echo ""
125
echo "The "
126
echo "${CHAPTER_LOWER} manager is ..."
127
echo ""
128
echo "The services provided by the ${CHAPTER_LOWER} manager are:"
129
echo ""
130
echo "@itemize @bullet"
131
 
132
for routine in ${ROUTINES}
133
do
134
  description=`grep " ${routine} " ../../itron_spec/itron3-1.txt | grep "]" | cut -d']' -f2 `
135
  description=`echo ${description}`
136
  echo "@item @code{${routine}} - ${description}"
137
done
138
echo "@end itemize"
139
 
140
echo ""
141
echo "@section Background"
142
echo ""
143
echo "@section Operations"
144
echo ""
145
echo "@section System Calls"
146
echo ""
147
echo "This section details the ${CHAPTER_LOWER} manager's services."
148
echo "A subsection is dedicated to each of this manager's services"
149
echo "and describes the calling sequence, related constants, usage,"
150
echo "and status codes."
151
echo ""
152
 
153
for routine in ${ROUTINES}
154
do
155
  description=`grep ${routine} ../../itron_spec/itron3-1.txt | grep "]" | cut -d']' -f2`
156
  description=`echo -n ${description}`
157
  echo ""
158
  echo "@c"
159
  echo "@c  ${routine}"
160
  echo "@c"
161
  echo ""
162
  echo "@page"
163
  echo "@subsection ${routine} - " ${description}
164
  echo ""
165
  echo "@subheading CALLING SEQUENCE:"
166
  echo ""
167
  echo "@ifset is-C"
168
  echo "@example"
169
  proto=`grep "${routine} (" ../../itron_spec/itron3-6.txt | sed -e 's/ercd = //'`   # | sed -e 's/ \\(/(/'`
170
 
171
  echo `echo -n ${proto} | cut -d'(' -f1`"("
172
  echo ${proto} | cut -d'(' -f2 | sed -e 's/ .;//'
173
  echo ");"
174
  # echo "int ${routine}("
175
  # echo ");"
176
  echo "@end example"
177
  echo "@end ifset"
178
  echo ""
179
  echo "@ifset is-Ada"
180
  echo "@end ifset"
181
  echo ""
182
  echo "@subheading STATUS CODES:"
183
  echo ""
184
  echo "@code{EXXX} - "
185
  echo ""
186
  echo "@subheading DESCRIPTION:"
187
  echo ""
188
  echo "@subheading NOTES:"
189
  echo ""
190
done
191
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.