[363] | 1 | /*
|
---|
| 2 | * TOPPERS/JSP Kernel
|
---|
| 3 | * Toyohashi Open Platform for Embedded Real-Time Systems/
|
---|
| 4 | * Just Standard Profile Kernel
|
---|
| 5 | *
|
---|
| 6 | * Copyright (C) 2000-2004 by Embedded and Real-Time Systems Laboratory
|
---|
| 7 | * Toyohashi Univ. of Technology, JAPAN
|
---|
| 8 | * Copyright (C) 2001-2004 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: sys_config.c,v 1.5 2005/07/06 00:45:07 honda Exp $
|
---|
| 54 | */
|
---|
| 55 |
|
---|
| 56 | #include "jsp_kernel.h"
|
---|
| 57 | #include <sil.h>
|
---|
| 58 | #include <s_services.h>
|
---|
| 59 | #include "sh7615scif.h"
|
---|
| 60 | /*
|
---|
| 61 | * ã¿ã¼ã²ããã·ã¹ãã ä¾åã®åæå
|
---|
| 62 | */
|
---|
| 63 | /* å
|
---|
| 64 | ¥åºåãã¼ãã®è¨å®ã¯sys_config.c */
|
---|
| 65 | /* å²è¾¼ã¿ãã¯ã¿çªå·ã®è¨å®ã¯hw_serial.h */
|
---|
| 66 | /* 管çãããã¯ã®è¨å®ã¯sh7615scif.c */
|
---|
| 67 | void
|
---|
| 68 | sys_initialize ()
|
---|
| 69 | {
|
---|
| 70 | SIOPCB *siopcb;
|
---|
| 71 |
|
---|
| 72 | /* 使ç¨ããå¨è¾ºæ©å¨ã¯ããã§æå¹ã«ãã¦ããã */
|
---|
| 73 | /* SCIFãã¼ã¿å
|
---|
| 74 | ¥åºåãã¼ãã®è¨å® */
|
---|
| 75 | #ifndef GDB_STUB
|
---|
| 76 |
|
---|
| 77 | /* SCIF1 */
|
---|
| 78 | sil_wrh_mem (PBCR, sil_reh_mem (PBCR) | (0x0800 | 0x2000));
|
---|
| 79 | #if TNUM_PORT >= 2
|
---|
| 80 | /* SCIF2 */
|
---|
| 81 | sil_wrh_mem (PBCR2, sil_reh_mem (PBCR2) | (0x0200 | 0x0800));
|
---|
| 82 | #endif /* TNUM_PORT >= 2 */
|
---|
| 83 |
|
---|
| 84 | #else /* GDB_STUB */
|
---|
| 85 |
|
---|
| 86 | /* SCIF2 */
|
---|
| 87 | sil_wrh_mem (PBCR2, sil_reh_mem (PBCR2) | (0x0200 | 0x0800));
|
---|
| 88 |
|
---|
| 89 | #endif /* GDB_STUB */
|
---|
| 90 | /*
|
---|
| 91 | * ããã¤ã¹ä¾åã®ãªã¼ãã³å¦çï¼
|
---|
| 92 | */
|
---|
| 93 | /*ããã¼åºåãããã */
|
---|
| 94 | sh2scif_initialize();
|
---|
| 95 | siopcb = sh2scif_opn_por (LOGTASK_PORTID, 0);
|
---|
| 96 |
|
---|
| 97 | #ifndef GDB_STUB
|
---|
| 98 | /* ãã¯ã¿çªå·ã®åæå */
|
---|
| 99 |
|
---|
| 100 | sil_wrw_mem (DMA_VCRDMA0, 72);
|
---|
| 101 | sil_wrw_mem (DMA_VCRDMA1, 73);
|
---|
| 102 |
|
---|
| 103 | sil_wrh_mem (VCRWDT, 74 * 0x100 + 75);
|
---|
| 104 | sil_wrh_mem (VCRA, 76 * 0x100);
|
---|
| 105 | sil_wrh_mem (VCRC, 77 * 0x100 + 78);
|
---|
| 106 | sil_wrh_mem (VCRD, 79 * 0x100);
|
---|
| 107 | sil_wrh_mem (VCRE, 80 * 0x100 + 81);
|
---|
| 108 | sil_wrh_mem (VCRF, 82 * 0x100 + 83);
|
---|
| 109 | sil_wrh_mem (VCRG, 84 * 0x100);
|
---|
| 110 | sil_wrh_mem (VCRH, 85 * 0x100 + 86);
|
---|
| 111 | sil_wrh_mem (VCRI, 87 * 0x100 + 88);
|
---|
| 112 | sil_wrh_mem (VCRJ, 89 * 0x100 + 90);
|
---|
| 113 | sil_wrh_mem (VCRK, 91 * 0x100 + 92);
|
---|
| 114 | sil_wrh_mem (VCRL, 93 * 0x100 + 94);
|
---|
| 115 | sil_wrh_mem (VCRM, 95 * 0x100 + 96);
|
---|
| 116 | sil_wrh_mem (VCRN, 97 * 0x100 + 98);
|
---|
| 117 | sil_wrh_mem (VCRO, 99 * 0x100 + 100);
|
---|
| 118 | sil_wrh_mem (VCRP, 101 * 0x100 + 102);
|
---|
| 119 | sil_wrh_mem (VCRQ, 103 * 0x100 + 104);
|
---|
| 120 | sil_wrh_mem (VCRR, 105 * 0x100 + 106);
|
---|
| 121 | sil_wrh_mem (VCRS, 107 * 0x100 + 108);
|
---|
| 122 | sil_wrh_mem (VCRT, 109 * 0x100 + 110);
|
---|
| 123 | sil_wrh_mem (VCRU, 111 * 0x100 + 112);
|
---|
| 124 | #endif /* GDB_STUB */
|
---|
| 125 |
|
---|
| 126 | }
|
---|
| 127 |
|
---|
| 128 | /*
|
---|
| 129 | * ã¿ã¼ã²ããã·ã¹ãã ã®çµäº
|
---|
| 130 | */
|
---|
| 131 | void
|
---|
| 132 | sys_exit()
|
---|
| 133 | {
|
---|
| 134 | sh2_exit();
|
---|
| 135 | }
|
---|
| 136 |
|
---|
| 137 | /*
|
---|
| 138 | * ã¿ã¼ã²ããã·ã¹ãã ã®æååºå
|
---|
| 139 | */
|
---|
| 140 | void
|
---|
| 141 | sys_putc(char c)
|
---|
| 142 | {
|
---|
| 143 | if (c == '\n') {
|
---|
| 144 | sh2_putc (LOGTASK_PORTID, '\r');
|
---|
| 145 | }
|
---|
| 146 | sh2_putc (LOGTASK_PORTID, c);
|
---|
| 147 | }
|
---|
| 148 |
|
---|
| 149 | /* ãã¼ãã¦ã§ã¢ã®è¨å® */
|
---|
| 150 | void
|
---|
| 151 | hardware_init_hook (void)
|
---|
| 152 | {
|
---|
| 153 | }
|
---|