summaryrefslogtreecommitdiffstats
path: root/doc/itron3.0/gen_section
blob: cdc1c80f2cef1030a29be292476daf308da917fe (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
#
#  This shell script generates the starting template for a manager chapter.
#


# Set this based on which chapter you want to generate a template for.
chapter=$1

case ${chapter} in 
  task)
    CHAPTER_CAPS="Task"
    CHAPTER_LOWER="task"
    ROUTINES=" cre_tsk del_tsk sta_tsk ext_tsk exd_tsk ter_tsk \
      dis_dsp ena_dsp chg_pri rot_rdq rel_wai get_tid ref_tsk"
    ;;

  tasksync)
    CHAPTER_CAPS="Task-Dependent Synchronization"
    CHAPTER_LOWER="task-dependent synchronization"
    ROUTINES=" sus_tsk rsm_tsk frsm_tsk \
      slp_tsk tslp_tsk wup_tsk can_wup"
    ;;

  semaphore)
    CHAPTER_CAPS="Semaphore"
    CHAPTER_LOWER="semaphore"
    ROUTINES="cre_sem del_sem sig_sem wai_sem preq_sem twai_sem ref_sem "
    ;;

  eventflags)
    CHAPTER_CAPS="Eventflags"
    CHAPTER_LOWER="eventflags"
    ROUTINES=" cre_flg del_flg set_flg clr_flg wai_flg pol_flg \
       twai_flg ref_flg "
    ;;

  mailbox)
    CHAPTER_CAPS="Mailbox"
    CHAPTER_LOWER="mailbox"
    ROUTINES="cre_mbx del_mbx snd_msg rcv_msg prcv_msg trcv_msg ref_mbx"
    ;;

  msgbuffer)
    CHAPTER_CAPS="Message Buffer"
    CHAPTER_LOWER="message buffer"
    ROUTINES=" cre_mbf del_mbf snd_mbf psnd_mbf tsnd_mbf rcv_mbf prcv_mbf \
      trcv_mbf ref_mbf "
    ;;

  rendezvous)
    CHAPTER_CAPS="Rendezvous"
    CHAPTER_LOWER="rendezvous"
    ROUTINES=" cre_por del_por cal_por pcal_por tcal_por acp_por pacp_por \
      tacp_por fwd_por rpl_rdv ref_por"
    ;;

  interrupt)
    CHAPTER_CAPS="Interrupt"
    CHAPTER_LOWER="interrupt"
    ROUTINES=" def_int ret_int ret_wup loc_cpu unl_cpu dis_int ena_int
      chg_iXX ref_iXX"
    ;;

  memorypool)
    CHAPTER_CAPS="Memory Pool"
    CHAPTER_LOWER="memory pool"
    ROUTINES=" cre_mpl del_mpl get_blk pget_blk tget_blk rel_blk ref_mpl"
    ;;

  fixedblock)
    CHAPTER_CAPS="Fixed Block"
    CHAPTER_LOWER="fixed block"
    ROUTINES=" cre_mpf del_mpf get_blf pget_blf tget_blf rel_blf ref_mpf"
    ;;


  time)
    CHAPTER_CAPS="Time"
    CHAPTER_LOWER="time"
    ROUTINES=" get_tim set_tim dly_tsk \
       def_cyc act_cyc ref_cyc \
       def_alm ref_alm ret_tmr"
    ;;

  config)  
    CHAPTER_CAPS="System"
    CHAPTER_LOWER="system"
    ROUTINES=" get_ver ref_sys ref_cfg def_svc def_exc"
    ;;

  network)
    CHAPTER_CAPS="Network Support"
    CHAPTER_LOWER="network support"
    ROUTINES=" nrea_dat nwri_dat nget_nod nget_ver"
    ;;
  psxtimer)
    CHAPTER_CAPS="Timer"
    CHAPTER_LOWER="timer"
    ROUTINES="timer_create timer_delete timer_settime timer_gettime timer_getoverrun"
    ;;
  *)
    echo "Unknown chapter name"
    exit 1
    ;;
esac

if [ "x${CHAPTER_CAPS}" = "x" -o "x${CHAPTER_LOWER}" = "x" \
     -o "x${ROUTINES}" = "x" ] ; then
  echo "initialization problem"
  exit 1
fi

echo "@c"
echo "@c  This is the chapter from the RTEMS ITRON User's Guide that"
echo "@c  documents the services provided by the ${CHAPTER_LOWER}"
echo "@c  manager."
echo "@c"
echo "@c  \$Id\$"
echo "@c"
echo ""
echo "@chapter ${CHAPTER_CAPS}" Manager
echo ""
echo "@section Introduction"
echo ""
echo "The "
echo "${CHAPTER_LOWER} manager is ..."
echo ""
echo "The services provided by the ${CHAPTER_LOWER} manager are:"
echo ""
echo "@itemize @bullet"

for routine in ${ROUTINES}
do
  description=`grep " ${routine} " ../../itron_spec/itron3-1.txt | grep "]" | cut -d']' -f2 `
  description=`echo ${description}`
  echo "@item @code{${routine}} - ${description}"
done
echo "@end itemize"

echo ""
echo "@section Background"
echo ""
echo "@section Operations"
echo ""
echo "@section System Calls"
echo ""
echo "This section details the ${CHAPTER_LOWER} manager's services."
echo "A subsection is dedicated to each of this manager's services"
echo "and describes the calling sequence, related constants, usage,"
echo "and status codes."
echo ""

for routine in ${ROUTINES}
do
  description=`grep ${routine} ../../itron_spec/itron3-1.txt | grep "]" | cut -d']' -f2`
  description=`echo -n ${description}`
  echo ""
  echo "@c"
  echo "@c  ${routine}"
  echo "@c"
  echo ""
  echo "@page"
  echo "@subsection ${routine} - " ${description}
  echo ""
  echo "@subheading CALLING SEQUENCE:"
  echo ""
  echo "@ifset is-C"
  echo "@example"
  proto=`grep "${routine} (" ../../itron_spec/itron3-6.txt | sed -e 's/ercd = //'`   # | sed -e 's/ \\(/(/'`
  
  echo `echo -n ${proto} | cut -d'(' -f1`"("
  echo ${proto} | cut -d'(' -f2 | sed -e 's/ .;//'
  echo ");"
  # echo "int ${routine}("
  # echo ");"
  echo "@end example"
  echo "@end ifset"
  echo ""
  echo "@ifset is-Ada"
  echo "@end ifset"
  echo ""
  echo "@subheading STATUS CODES:"
  echo ""
  echo "@code{EXXX} - "
  echo ""
  echo "@subheading DESCRIPTION:"
  echo ""
  echo "@subheading NOTES:"
  echo ""
done