[26] | 1 | /*
|
---|
| 2 | * TOPPERS/JSP Kernel
|
---|
| 3 | * Toyohashi Open Platform for Embedded Real-Time Systems/
|
---|
| 4 | * Just Standard Profile Kernel
|
---|
| 5 | *
|
---|
| 6 | * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
|
---|
| 7 | * Toyohashi Univ. of Technology, JAPAN
|
---|
| 8 | * Copyright (C) 2001-2003 by Industrial Technology Institute,
|
---|
| 9 | * Miyagi Prefectural Government, JAPAN
|
---|
| 10 | * Copyright (C) 2002-2004 by Hokkaido Industrial Research Institute, JAPAN
|
---|
| 11 | *
|
---|
| 12 | * ä¸è¨èä½æ¨©è
|
---|
| 13 | ã¯ï¼ä»¥ä¸ã® (1)ã(4) ã®æ¡ä»¶ãï¼Free Software Foundation
|
---|
| 14 | * ã«ãã£ã¦å
|
---|
| 15 | ¬è¡¨ããã¦ãã GNU General Public License ã® Version 2 ã«è¨
|
---|
| 16 | * è¿°ããã¦ããæ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§ã¢ï¼æ¬ã½ããã¦ã§ã¢
|
---|
| 17 | * ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ã使ç¨ã»è¤è£½ã»æ¹å¤ã»åé
|
---|
| 18 | å¸ï¼ä»¥ä¸ï¼
|
---|
| 19 | * å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
|
---|
| 20 | * (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
|
---|
| 21 | * 権表示ï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
|
---|
| 22 | * ã¹ã³ã¼ãä¸ã«å«ã¾ãã¦ãããã¨ï¼
|
---|
| 23 | * (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
|
---|
| 24 | * ç¨ã§ããå½¢ã§åé
|
---|
| 25 | å¸ããå ´åã«ã¯ï¼åé
|
---|
| 26 | å¸ã«ä¼´ãããã¥ã¡ã³ãï¼å©ç¨
|
---|
| 27 | * è
|
---|
| 28 | ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
|
---|
| 29 | * ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
|
---|
| 30 | * (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
|
---|
| 31 | * ç¨ã§ããªãå½¢ã§åé
|
---|
| 32 | å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
|
---|
| 33 | * ã¨ï¼
|
---|
| 34 | * (a) åé
|
---|
| 35 | å¸ã«ä¼´ãããã¥ã¡ã³ãï¼å©ç¨è
|
---|
| 36 | ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
|
---|
| 37 | * ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
|
---|
| 38 | * (b) åé
|
---|
| 39 | å¸ã®å½¢æ
|
---|
| 40 | ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSããã¸ã§ã¯ãã«
|
---|
| 41 | * å ±åãããã¨ï¼
|
---|
| 42 | * (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
|
---|
| 43 | * 害ãããï¼ä¸è¨èä½æ¨©è
|
---|
| 44 | ããã³TOPPERSããã¸ã§ã¯ããå
|
---|
| 45 | 責ãããã¨ï¼
|
---|
| 46 | *
|
---|
| 47 | * æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
|
---|
| 48 | ã
|
---|
| 49 | * ãã³TOPPERSããã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ãã®é©ç¨å¯è½æ§ã
|
---|
| 50 | * å«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´
|
---|
| 51 | * æ¥çã¾ãã¯éæ¥çã«çãããããªãæ害ã«é¢ãã¦ãï¼ãã®è²¬ä»»ãè² ããªãï¼
|
---|
| 52 | *
|
---|
| 53 | * @(#) $Id: sh7145sci.c,v 1.3 2005/07/06 00:45:07 honda Exp $
|
---|
| 54 | */
|
---|
| 55 |
|
---|
| 56 | /*
|
---|
| 57 | * SH2å
|
---|
| 58 | èµã·ãªã¢ã«ã³ãã¥ãã±ã¼ã·ã§ã³ã¤ã³ã¿ãã§ã¼ã¹SCIç¨ ç°¡æãã©ã¤ã
|
---|
| 59 | */
|
---|
| 60 |
|
---|
| 61 | #include <s_services.h>
|
---|
| 62 | #include "sh7145sci.h"
|
---|
| 63 |
|
---|
| 64 | /*
|
---|
| 65 | * ã·ãªã¢ã«I/Oãã¼ãåæåãããã¯
|
---|
| 66 | */
|
---|
| 67 | #ifndef GDB_STUB
|
---|
| 68 | const SIOPINIB siopinib_table[TNUM_PORT] = {
|
---|
| 69 | {0xffff81b0, BRR9600, 0x0, 6}, /* SCI1 */
|
---|
| 70 | #if TNUM_PORT >= 2
|
---|
| 71 | {0xffff81a0, BRR9600, 0x0, 6}, /* SCI0 */
|
---|
| 72 | #endif /* TNUM_PORT >= 2 */
|
---|
| 73 | };
|
---|
| 74 | #else /* GDB_STUB */
|
---|
| 75 | const SIOPINIB siopinib_table[TNUM_PORT] = {
|
---|
| 76 | {0xffff81a0, BRR9600, 0x0, 6}, /* SCI0 */
|
---|
| 77 | };
|
---|
| 78 | #endif /* GDB_STUB */
|
---|
| 79 |
|
---|
| 80 |
|
---|
| 81 | /*
|
---|
| 82 | * ã·ãªã¢ã«I/Oãã¼ã管çãããã¯ã®ã¨ãªã¢
|
---|
| 83 | */
|
---|
| 84 | static SIOPCB siopcb_table[TNUM_PORT];
|
---|
| 85 |
|
---|
| 86 | /*
|
---|
| 87 | * ã·ãªã¢ã«I/Oãã¼ãIDãã管çãããã¯ãåãåºãããã®ãã¯ã
|
---|
| 88 | */
|
---|
| 89 | /* ãã¼ãIDããããã¤ã¹çªå·ãæ±ãããã¯ã */
|
---|
| 90 | #define INDEX_SIOP(siopid) ((UINT)((siopid) - 1))
|
---|
| 91 | #define get_siopcb(siopid) (&(siopcb_table[INDEX_SIOP(siopid)]))
|
---|
| 92 |
|
---|
| 93 | /*
|
---|
| 94 | * æåãåä¿¡ã§ãããï¼
|
---|
| 95 | */
|
---|
| 96 | Inline BOOL
|
---|
| 97 | sh2sci_getready (SIOPCB * siopcb)
|
---|
| 98 | {
|
---|
| 99 | /* ã¬ã·ã¼ããã¼ã¿ã¬ã¸ã¹ã¿ãã«ã»ãã©ã°ã®ãã§ã㯠*/
|
---|
| 100 | return (sil_reb_mem ((VB *) (siopcb->siopinib->reg_base + SCI_SSR)) &
|
---|
| 101 | SSR_RDRF);
|
---|
| 102 | }
|
---|
| 103 |
|
---|
| 104 | /*
|
---|
| 105 | * æåãéä¿¡ã§ãããï¼
|
---|
| 106 | */
|
---|
| 107 | Inline BOOL
|
---|
| 108 | sh2sci_putready (SIOPCB * siopcb)
|
---|
| 109 | {
|
---|
| 110 | /* ãã©ã³ã¹ããããã¼ã¿ã¬ã¸ã¹ã¿ã¨ã³ããã£ã»ãã©ã°ã®ãã§ã㯠*/
|
---|
| 111 | return (sil_reb_mem ((VB *) (siopcb->siopinib->reg_base + SCI_SSR)) &
|
---|
| 112 | SSR_TDRE);
|
---|
| 113 | }
|
---|
| 114 |
|
---|
| 115 | /*
|
---|
| 116 | * åä¿¡ããæåã®ååºã
|
---|
| 117 | */
|
---|
| 118 | Inline char
|
---|
| 119 | sh2sci_getchar (SIOPCB * siopcb)
|
---|
| 120 | {
|
---|
| 121 | char data;
|
---|
| 122 |
|
---|
| 123 | data = sil_reb_mem ((VB *) (siopcb->siopinib->reg_base + SCI_RDR));
|
---|
| 124 | /* ã¬ã·ã¼ããã¼ã¿ã¬ã¸ã¹ã¿ãã«ã»ãã©ã°ã®ã¯ãªã¢ */
|
---|
| 125 | sil_wrb_mem ((VB *) (siopcb->siopinib->reg_base + SCI_SSR),
|
---|
| 126 | sil_reb_mem ((VB *) (siopcb->siopinib->reg_base +
|
---|
| 127 | SCI_SSR)) & ~SSR_RDRF);
|
---|
| 128 | return data;
|
---|
| 129 | }
|
---|
| 130 |
|
---|
| 131 | /*
|
---|
| 132 | * éä¿¡ããæåã®æ¸è¾¼ã¿
|
---|
| 133 | */
|
---|
| 134 | Inline void
|
---|
| 135 | sh2sci_putchar (SIOPCB * siopcb, char c)
|
---|
| 136 | {
|
---|
| 137 | sil_wrb_mem ((VB *) (siopcb->siopinib->reg_base + SCI_TDR), c);
|
---|
| 138 | sil_wrb_mem ((VB *) (siopcb->siopinib->reg_base + SCI_SSR),
|
---|
| 139 | sil_reb_mem ((VB *) (siopcb->siopinib->reg_base +
|
---|
| 140 | SCI_SSR)) & ~SSR_TDRE);
|
---|
| 141 | }
|
---|
| 142 |
|
---|
| 143 | /*
|
---|
| 144 | * SIOãã©ã¤ãã®åæåã«ã¼ãã³
|
---|
| 145 | */
|
---|
| 146 | void
|
---|
| 147 | sh2sci_initialize ()
|
---|
| 148 | {
|
---|
| 149 | SIOPCB *siopcb;
|
---|
| 150 | UINT i;
|
---|
| 151 |
|
---|
| 152 | /*
|
---|
| 153 | * ã·ãªã¢ã«I/Oãã¼ã管çãããã¯ã®åæå
|
---|
| 154 | */
|
---|
| 155 | for (siopcb = siopcb_table, i = 0; i < TNUM_PORT; siopcb++, i++) {
|
---|
| 156 | siopcb->openflag = FALSE;
|
---|
| 157 | siopcb->siopinib = (&siopinib_table[i]);
|
---|
| 158 | }
|
---|
| 159 | }
|
---|
| 160 |
|
---|
| 161 | /*
|
---|
| 162 | * ãªã¼ãã³ãã¦ãããã¼ãããããï¼
|
---|
| 163 | */
|
---|
| 164 | BOOL
|
---|
| 165 | sh2sci_openflag (ID siopid)
|
---|
| 166 | {
|
---|
| 167 | return (siopcb_table[siopid - 1].openflag);
|
---|
| 168 | }
|
---|
| 169 |
|
---|
| 170 | /*
|
---|
| 171 | * ã·ãªã¢ã«I/Oãã¼ãã®ãªã¼ãã³
|
---|
| 172 | */
|
---|
| 173 | SIOPCB *
|
---|
| 174 | sh2sci_opn_por (ID siopid, VP_INT exinf)
|
---|
| 175 | {
|
---|
| 176 | SIOPCB *siopcb = get_siopcb (siopid);
|
---|
| 177 |
|
---|
| 178 | /* éåä¿¡åæ¢ */
|
---|
| 179 | sil_wrb_mem ((VB *) (siopcb->siopinib->reg_base + SCI_SCR), 0x00);
|
---|
| 180 |
|
---|
| 181 | /* SCIãã¼ã¿å
|
---|
| 182 | ¥åºåãã¼ãã®è¨å® */
|
---|
| 183 | /* ãã³ã¢ãµã¤ã³ */
|
---|
| 184 | /* sys_initializeã§è¨å® */
|
---|
| 185 |
|
---|
| 186 | /* éåä¿¡ãã©ã¼ããã */
|
---|
| 187 | /* 調æ©åæå¼ */
|
---|
| 188 | /* 8ããããããªãã£ãªã */
|
---|
| 189 | /* ã¹ããããããã¬ã³ã°ã¹ï¼1 */
|
---|
| 190 | /* ã¯ããã¯ã»ã¬ã¯ã */
|
---|
| 191 |
|
---|
| 192 | sil_wrb_mem ((VB *) (siopcb->siopinib->reg_base + SCI_SMR),
|
---|
| 193 | siopcb->siopinib->smr);
|
---|
| 194 | sil_wrb_mem ((VB *) (siopcb->siopinib->reg_base + SCI_BRR),
|
---|
| 195 | (VB) siopcb->siopinib->brr);
|
---|
| 196 |
|
---|
| 197 | /*
|
---|
| 198 | * ãã¼ã¬ã¼ãã®è¨å®å¾ã1ã«ã¦ã³ãåå¾
|
---|
| 199 | ããªããã°ãªããªãã
|
---|
| 200 | */
|
---|
| 201 | sil_dly_nse (sh2sci_DELAY); /* å¤ã¯ï½ï½ï¼ã¨åã */
|
---|
| 202 |
|
---|
| 203 | /* ã¨ã©ã¼ãã©ã°ãã¯ãªã¢ */
|
---|
| 204 | sil_wrb_mem ((VB *) (siopcb->siopinib->reg_base + SCI_SSR),
|
---|
| 205 | sil_reb_mem ((VB *) (siopcb->siopinib->reg_base +
|
---|
| 206 | SCI_SSR)) & ~(SSR_ORER | SSR_FER |
|
---|
| 207 | SSR_PER));
|
---|
| 208 | /*éå信許å¯ãåä¿¡å²ãè¾¼ã¿è¨±å¯ */
|
---|
| 209 | sil_wrb_mem ((VB *) (siopcb->siopinib->reg_base + SCI_SCR),
|
---|
| 210 | (VB) (SCI_RIE | SCI_TE | SCI_RE));
|
---|
| 211 |
|
---|
| 212 | siopcb->exinf = exinf;
|
---|
| 213 | siopcb->openflag = TRUE;
|
---|
| 214 | return (siopcb);
|
---|
| 215 | }
|
---|
| 216 |
|
---|
| 217 | /*
|
---|
| 218 | * ã·ãªã¢ã«I/Oãã¼ãã®ã¯ãã¼ãº
|
---|
| 219 | */
|
---|
| 220 | void
|
---|
| 221 | sh2sci_cls_por (SIOPCB * siopcb)
|
---|
| 222 | {
|
---|
| 223 | /* éåä¿¡åæ¢ãå²è¾¼ã¿ç¦æ¢ */
|
---|
| 224 | sil_wrb_mem ((VB *) (siopcb->siopinib->reg_base + SCI_SCR),
|
---|
| 225 | sil_reb_mem ((VB *) (siopcb->siopinib->reg_base +
|
---|
| 226 | SCI_SCR)) & (VB) ~ (SCI_TIE | SCI_RIE |
|
---|
| 227 | SCI_TE | SCI_RE));
|
---|
| 228 | siopcb->openflag = FALSE;
|
---|
| 229 | }
|
---|
| 230 |
|
---|
| 231 | /*
|
---|
| 232 | * ã·ãªã¢ã«I/Oãã¼ãã¸ã®æåéä¿¡
|
---|
| 233 | */
|
---|
| 234 | BOOL
|
---|
| 235 | sh2sci_snd_chr (SIOPCB * siopcb, char c)
|
---|
| 236 | {
|
---|
| 237 | if (sh2sci_putready (siopcb)) {
|
---|
| 238 | sh2sci_putchar (siopcb, c);
|
---|
| 239 | return (TRUE);
|
---|
| 240 | }
|
---|
| 241 | return (FALSE);
|
---|
| 242 | }
|
---|
| 243 |
|
---|
| 244 | /*
|
---|
| 245 | * ã·ãªã¢ã«I/Oãã¼ãããã®æååä¿¡
|
---|
| 246 | */
|
---|
| 247 | INT
|
---|
| 248 | sh2sci_rcv_chr (SIOPCB * siopcb)
|
---|
| 249 | {
|
---|
| 250 | if (sh2sci_getready (siopcb)) {
|
---|
| 251 | return ((INT) (UB) sh2sci_getchar (siopcb));
|
---|
| 252 | /* (UB)ã§ãã£ã¹ãããã®ã¯ã¼ãæ¡å¼µã«ãããã */
|
---|
| 253 | }
|
---|
| 254 | return (-1);
|
---|
| 255 | }
|
---|
| 256 |
|
---|
| 257 | /*
|
---|
| 258 | * ã·ãªã¢ã«I/Oãã¼ãããã®ã³ã¼ã«ããã¯ã®è¨±å¯
|
---|
| 259 | */
|
---|
| 260 | void
|
---|
| 261 | sh2sci_ena_cbr (SIOPCB * siopcb, UINT cbrtn)
|
---|
| 262 | {
|
---|
| 263 | switch (cbrtn) {
|
---|
| 264 | case SIO_ERDY_SND: /* éä¿¡å²ãè¾¼ã¿è¦æ±ãè¨±å¯ */
|
---|
| 265 | sil_wrb_mem ((VB *) (siopcb->siopinib->reg_base + SCI_SCR),
|
---|
| 266 | sil_reb_mem ((VB *) (siopcb->siopinib->reg_base +
|
---|
| 267 | SCI_SCR)) | SCI_TIE);
|
---|
| 268 | break;
|
---|
| 269 | case SIO_ERDY_RCV: /* åä¿¡å²ãè¾¼ã¿è¦æ±ãè¨±å¯ */
|
---|
| 270 | sil_wrb_mem ((VB *) (siopcb->siopinib->reg_base + SCI_SCR),
|
---|
| 271 | sil_reb_mem ((VB *) (siopcb->siopinib->reg_base +
|
---|
| 272 | SCI_SCR)) | SCI_RIE);
|
---|
| 273 | break;
|
---|
| 274 | }
|
---|
| 275 | }
|
---|
| 276 |
|
---|
| 277 | /*
|
---|
| 278 | * ã·ãªã¢ã«I/Oãã¼ãããã®ã³ã¼ã«ããã¯ã®ç¦æ¢
|
---|
| 279 | */
|
---|
| 280 | void
|
---|
| 281 | sh2sci_dis_cbr (SIOPCB * siopcb, UINT cbrtn)
|
---|
| 282 | {
|
---|
| 283 | switch (cbrtn) {
|
---|
| 284 | case SIO_ERDY_SND: /* éä¿¡å²ãè¾¼ã¿è¦æ±ãç¦æ¢ */
|
---|
| 285 | sil_wrb_mem ((VB *) (siopcb->siopinib->reg_base + SCI_SCR),
|
---|
| 286 | sil_reb_mem ((VB *) (siopcb->siopinib->reg_base +
|
---|
| 287 | SCI_SCR)) & ~SCI_TIE);
|
---|
| 288 | break;
|
---|
| 289 | case SIO_ERDY_RCV: /* åä¿¡å²ãè¾¼ã¿è¦æ±ãç¦æ¢ */
|
---|
| 290 | sil_wrb_mem ((VB *) (siopcb->siopinib->reg_base + SCI_SCR),
|
---|
| 291 | sil_reb_mem ((VB *) (siopcb->siopinib->reg_base +
|
---|
| 292 | SCI_SCR)) & ~SCI_RIE);
|
---|
| 293 | break;
|
---|
| 294 | }
|
---|
| 295 | }
|
---|
| 296 |
|
---|
| 297 | /*
|
---|
| 298 | * ã·ãªã¢ã«I/Oãã¼ãã«å¯¾ããéä¿¡å²è¾¼ã¿å¦ç
|
---|
| 299 | */
|
---|
| 300 | Inline void
|
---|
| 301 | sh2sci_isr_siop_out (SIOPCB * siopcb)
|
---|
| 302 | {
|
---|
| 303 | VB scr0 = sil_reb_mem ((VB *) (siopcb->siopinib->reg_base + SCI_SCR));
|
---|
| 304 |
|
---|
| 305 | if ((scr0 & SCI_TIE) != 0 && sh2sci_putready (siopcb)) {
|
---|
| 306 | /*
|
---|
| 307 | * éä¿¡éç¥ã³ã¼ã«ããã¯ã«ã¼ãã³ãå¼ã³åºãï¼
|
---|
| 308 | */
|
---|
| 309 | sh2sci_ierdy_snd (siopcb->exinf);
|
---|
| 310 | }
|
---|
| 311 | }
|
---|
| 312 |
|
---|
| 313 | /*
|
---|
| 314 | * ã·ãªã¢ã«I/Oãã¼ãã«å¯¾ããåä¿¡å²è¾¼ã¿å¦ç
|
---|
| 315 | */
|
---|
| 316 | Inline void
|
---|
| 317 | sh2sci_isr_siop_in (SIOPCB * siopcb)
|
---|
| 318 | {
|
---|
| 319 | VB scr0 = sil_reb_mem ((VB *) (siopcb->siopinib->reg_base + SCI_SCR));
|
---|
| 320 |
|
---|
| 321 | if ((scr0 & SCI_RIE) != 0 && sh2sci_getready (siopcb)) {
|
---|
| 322 | /*
|
---|
| 323 | * åä¿¡éç¥ã³ã¼ã«ããã¯ã«ã¼ãã³ãå¼ã³åºãï¼
|
---|
| 324 | */
|
---|
| 325 | sh2sci_ierdy_rcv (siopcb->exinf);
|
---|
| 326 | }
|
---|
| 327 | }
|
---|
| 328 |
|
---|
| 329 | /*
|
---|
| 330 | * ã·ãªã¢ã«I/Oãã¼ãã«å¯¾ããåä¿¡ã¨ã©ã¼å²è¾¼ã¿å¦ç
|
---|
| 331 | */
|
---|
| 332 | Inline void
|
---|
| 333 | sh2sci_isr_siop_err (SIOPCB * siopcb)
|
---|
| 334 | {
|
---|
| 335 | sil_wrb_mem ((VB *) (siopcb->siopinib->reg_base + SCI_SSR),
|
---|
| 336 | sil_reb_mem ((VB *) (siopcb->siopinib->reg_base +
|
---|
| 337 | SCI_SSR)) & ~(SSR_ORER | SSR_FER |
|
---|
| 338 | SSR_PER));
|
---|
| 339 | }
|
---|
| 340 |
|
---|
| 341 | /*
|
---|
| 342 | * SCIéä¿¡å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³
|
---|
| 343 | *
|
---|
| 344 | */
|
---|
| 345 | void
|
---|
| 346 | sh2sci_isr_out (void)
|
---|
| 347 | {
|
---|
| 348 | if (siopcb_table[0].openflag) {
|
---|
| 349 | sh2sci_isr_siop_out (get_siopcb (1));
|
---|
| 350 | }
|
---|
| 351 | }
|
---|
| 352 |
|
---|
| 353 | /*
|
---|
| 354 | * SIOåä¿¡å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³
|
---|
| 355 | *
|
---|
| 356 | */
|
---|
| 357 | void
|
---|
| 358 | sh2sci_isr_in (void)
|
---|
| 359 | {
|
---|
| 360 | if (siopcb_table[0].openflag) {
|
---|
| 361 | sh2sci_isr_siop_in (get_siopcb (1));
|
---|
| 362 | }
|
---|
| 363 | }
|
---|
| 364 |
|
---|
| 365 | /*
|
---|
| 366 | * SIOåä¿¡ã¨ã©ã¼å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³
|
---|
| 367 | */
|
---|
| 368 | void
|
---|
| 369 | sh2sci_isr_error (void)
|
---|
| 370 | {
|
---|
| 371 | if (siopcb_table[0].openflag) {
|
---|
| 372 | sh2sci_isr_siop_err (get_siopcb (1));
|
---|
| 373 | }
|
---|
| 374 | }
|
---|
| 375 |
|
---|
| 376 | /*
|
---|
| 377 | * ãã¼ãªã³ã°ã«ããæåã®éä¿¡
|
---|
| 378 | */
|
---|
| 379 | void
|
---|
| 380 | sh2sci_putc_pol (ID portid, char c)
|
---|
| 381 | {
|
---|
| 382 | while (!sh2sci_putready (&siopcb_table[portid - 1]));
|
---|
| 383 | sh2sci_putchar (&siopcb_table[portid - 1], c);
|
---|
| 384 | }
|
---|
| 385 |
|
---|
| 386 |
|
---|
| 387 | #if TNUM_PORT >= 2
|
---|
| 388 | /*
|
---|
| 389 | * SIOåä¿¡å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³
|
---|
| 390 | *
|
---|
| 391 | */
|
---|
| 392 | void
|
---|
| 393 | sh2sci_isr2_in (void)
|
---|
| 394 | {
|
---|
| 395 | if (siopcb_table[1].openflag) {
|
---|
| 396 | sh2sci_isr_siop_in (get_siopcb (2));
|
---|
| 397 | }
|
---|
| 398 | }
|
---|
| 399 |
|
---|
| 400 | /*
|
---|
| 401 | * SCIéä¿¡å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³
|
---|
| 402 | *
|
---|
| 403 | */
|
---|
| 404 | void
|
---|
| 405 | sh2sci_isr2_out (void)
|
---|
| 406 | {
|
---|
| 407 | if (siopcb_table[1].openflag) {
|
---|
| 408 | sh2sci_isr_siop_out (get_siopcb (2));
|
---|
| 409 | }
|
---|
| 410 | }
|
---|
| 411 |
|
---|
| 412 | /*
|
---|
| 413 | * SIOåä¿¡ã¨ã©ã¼å²è¾¼ã¿ãµã¼ãã¹ã«ã¼ãã³
|
---|
| 414 | */
|
---|
| 415 | void
|
---|
| 416 | sh2sci_isr2_error (void)
|
---|
| 417 | {
|
---|
| 418 | if (siopcb_table[1].openflag) {
|
---|
| 419 | sh2sci_isr_siop_err (get_siopcb (2));
|
---|
| 420 | }
|
---|
| 421 | }
|
---|
| 422 | #endif /* of #if TNUM_PORT >= 2 */
|
---|