# %jp{リンク制御対象制御}
-LINK_JELLYUART = Yes
-LINK_JELLYI2C = Yes
+LINK_XILINXUARTDRV = Yes
# %jp{共通ソース}
#include "system/file/console.h"
#include "system/process/process.h"
#include "system/command/command.h"
-#include "driver/serial/jelly/jellyuartdrv.h"
+#include "driver/serial/xilinxuartdrv/xilinxuartdrv.h"
#include "driver/console/vt100/vt100drv.h"
#include "application//syscmd/shell/shell.h"
#include "application//syscmd/commandlist/commandlist.h"
#include "ostimer.h"
-#if 0
-
-long g_SystemHeap[128 * 1024 / sizeof(long)];
+long g_SystemHeap[16 * 1024 / sizeof(long)];
#define SYSTEM_HEAP_ADDR ((void *)g_SystemHeap)
#define SYSTEM_HEAP_SIZE sizeof(g_SystemHeap)
-#else
-
-#define SYSTEM_HEAP_ADDR ((void *)0x00200000)
-#define SYSTEM_HEAP_SIZE 0x00100000
-
-#endif
-
-
-extern SYSTIM_CPUTIME SysTim_TimeCounter; /* デフォルトのタイマカウンタ */
OsTimer_Initialize();
/* Jelly UART デバドラ生成 (/dev/com0 に登録) */
- hDriver = JellyUartDrv_Create((void *)0xf2000000, 1, 2, 64);
+ hDriver = XilinxUartDrv_Create((void *)0x40600000, 1, 64);
File_AddDevice("com0", hDriver);
/* シリアルを開く */
************************************************/
.align 2
_reset_handler:
+ /* キャッシュON */
+ addik r3, r0, 0x000000a0
+ mts rmsr, r3
+
+ /* BIPクリア(念の為) */
+ addik r3, r0, bip_clear
+ rtbd r3, 0
+bip_clear:
+
/* スタック設定 */
lwi r1, r0, _kernel_int_isp
MEMORY
{
- vector : o = 0x00000000, l = 0x00000050
- ro : o = 0x00000100, l = 0x000fff00
- rw : o = 0x00100000, l = 0x00100000
+ ro : o = 0x00000100, l = 0x0001ff00
+ rw : o = 0x00020000, l = 0x00020000
}
SECTIONS
{
- .vector :
+ .vectors.reset 0x00000000 :
{
- ___vector = . ;
- */vectors.o(.text)
- FILL(0xff)
- ___vector_end = . ;
- } > vector
+ *(.vectors.reset)
+ }
+ .vectors.sw_exception 0x00000008 :
+ {
+ *(.vectors.sw_exception)
+ }
+ .vectors.interrupt 0x00000010 :
+ {
+ *(.vectors.interrupt)
+ }
+ .vectors.hw_exception 0x00000020 :
+ {
+ *(.vectors.hw_exception)
+ }
+
.text :
{
___text = . ;
.global _kernel_hwe_hdr
- .text
.align 2
/* --------------------------------------- */
/* ベクタ定義 */
/* --------------------------------------- */
- bri _reset_handler
- nop
+
+ .section .vectors.reset, "ax"
+ brai _reset_handler
+
+ .section .vectors.sw_exception, "ax"
bri _kernel_exc_hdr
- nop
+
+ .section .vectors.interrupt, "ax"
bri _kernel_int_hdr
- nop
- bri _kernel_brk_hdr
- nop
+
+ .section .vectors.hw_exception, "ax"
bri _kernel_hwe_hdr
+++ /dev/null
-/**
- * Sample program for Hyper Operating System V4 Advance
- *
- * @file uart.c
- * @brief %jp{UARTへの出力}%en{UART device driver}
- *
- * Copyright (C) 1998-2006 by Project HOS
- * http://sourceforge.jp/projects/hos/
- */
-
-
-#include "kernel.h"
-
-
-#define REG_UART_BASE 0x40600000
-#define REG_UART_RX ((volatile unsigned long *)(REG_UART_BASE + 0x0))
-#define REG_UART_TX ((volatile unsigned long *)(REG_UART_BASE + 0x4))
-#define REG_UART_STAT ((volatile unsigned long *)(REG_UART_BASE + 0x8))
-#define REG_UART_CTRL ((volatile unsigned long *)(REG_UART_BASE + 0xc))
-
-
-/* %jp{UARTの初期化} */
-void Uart_Initialize(void)
-{
-}
-
-
-/* %jp{1文字入力} */
-char Uart_GetChar(void)
-{
- return 0;
-}
-
-
-/* %jp{1文字出力} */
-void Uart_PutChar(int c)
-{
- while ( *REG_UART_STAT & 0x08 )
- ;
-
- *REG_UART_TX = c;
-}
-
-
-/* %jp{文字列出力} */
-void Uart_PutString(const char *text)
-{
- while ( *text != '\0' )
- {
- if ( *text == '\n' )
- {
- Uart_PutChar('\r');
- Uart_PutChar('\n');
- }
- else
- {
- Uart_PutChar(*text);
- }
-
- text++;
- }
-}
-
-
-char Uart_hex2asc(int a)
-{
- if ( a < 10 )
- {
- return '0' + a;
- }
- return 'a' + a - 10;
-}
-
-
-void Uart_PutHexByte(char c)
-{
- Uart_PutChar(Uart_hex2asc((c >> 4) & 0xf));
- Uart_PutChar(Uart_hex2asc((c >> 0) & 0xf));
-}
-
-
-void Uart_PutHexHalfWord(unsigned short h)
-{
- Uart_PutHexByte((h >> 8) & 0xff);
- Uart_PutHexByte((h >> 0) & 0xff);
-}
-
-void Uart_PutHexWord(unsigned long w)
-{
- Uart_PutHexHalfWord((w >> 16) & 0xffff);
- Uart_PutHexHalfWord((w >> 0) & 0xffff);
-}
-
-
-
-/* end of file */
+++ /dev/null
-/**
- * Sample program for Hyper Operating System V4 Advance
- *
- * @file uart.h
- * @brief %jp{UARTへの出力}%en{UART device driver}
- *
- * Copyright (C) 1998-2006 by Project HOS
- * http://sourceforge.jp/projects/hos/
- */
-
-
-#ifndef __ostimer_h__
-#define __ostimer_h__
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void Uart_Initialize(void); /* %jp{UART の初期化} */
-void Uart_PutChar(int c); /* %jp{1文字出力} */
-void Uart_PutString(const char *text); /* %jp{文字列出力} */
-
-void Uart_PutHexByte(char c);
-void Uart_PutHexHalfWord(unsigned short h);
-void Uart_PutHexWord(unsigned long w);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif /* __ostimer_h__ */
-
-
-/* end of file */
#define ICTXCB_ISP 0
-#define ICTXCB_INTCNT 4
-#define ICTXCB_IMSK 6
/************************************************
.align 2
_kernel_int_hdr:
/* ---- レジスタ保存 */
- addik r1, r1, -76
+ addik r1, r1, -80
swi r14, r1, 0
swi r3, r1, 28
swi r4, r1, 32
swi r11, r1, 60
swi r12, r1, 64
swi r15, r1, 68
+ swi r18, r1, 72
mfs r3, rmsr
- swi r3, r1, 72
+ swi r3, r1, 76
/* ---- スタック入れ替え */
addik r3, r1, 0
lwi r1, r1, 28 /* スタックの復帰 */
/* ---- レジスタ復帰 */
- lwi r3, r1, 72
+ lwi r3, r1, 76
mts rmsr, r3
lwi r14, r1, 0
lwi r3, r1, 28
lwi r11, r1, 60
lwi r12, r1, 64
lwi r15, r1, 68
+ lwi r18, r1, 72
rtid r14, 0
- addik r1, r1, 76
+ addik r1, r1, 80
/* end of file */
MEMORY
{
- vector : o = 0x00000000, l = 0x00000050
ro : o = 0x00000100, l = 0x00007f00
rw : o = 0x00008000, l = 0x00008000
}
SECTIONS
{
- .vector :
+ .vectors.reset 0x00000000 :
{
- ___vector = . ;
- */vectors.o(.text)
- FILL(0xff)
- ___vector_end = . ;
- } > vector
+ *(.vectors.reset)
+ }
+ .vectors.sw_exception 0x00000008 :
+ {
+ *(.vectors.sw_exception)
+ }
+ .vectors.interrupt 0x00000010 :
+ {
+ *(.vectors.interrupt)
+ }
+ .vectors.hw_exception 0x00000020 :
+ {
+ *(.vectors.hw_exception)
+ }
+
.text :
{
___text = . ;
.global _kernel_hwe_hdr
- .text
.align 2
/* --------------------------------------- */
/* ベクタ定義 */
/* --------------------------------------- */
- bri _reset_handler
- nop
+
+ .section .vectors.reset, "ax"
+ brai _reset_handler
+
+ .section .vectors.sw_exception, "ax"
bri _kernel_exc_hdr
- nop
+
+ .section .vectors.interrupt, "ax"
bri _kernel_int_hdr
- nop
- bri _kernel_brk_hdr
- nop
+
+ .section .vectors.hw_exception, "ax"
bri _kernel_hwe_hdr