summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorGavin.Bai <gavin_8724@163.com>2019-08-27 06:28:42 (GMT)
committer Gavin.Bai <gavin_8724@163.com>2019-08-27 06:28:42 (GMT)
commit5cd8dcdcea02fa5a97e22704139ccfac3d070dd7 (patch)
tree2459429a1a523ac63992a8ba2e4e8c3a328338bc
parent52dafbf1bee017ce5c59e96ffc0dad2f455e2664 (diff)
downloadAIC-OS-5cd8dcdcea02fa5a97e22704139ccfac3d070dd7.zip
Update config for GJB test.
-rw-r--r--SylixOS/config/gjb/gjb_cfg.h2
-rw-r--r--SylixOS/config/kernel/kernel_cfg.h2
-rw-r--r--SylixOS/kernel/include/k_globalvar.h1
-rw-r--r--SylixOS/kernel/vmm/vmmAbort.c19
-rw-r--r--SylixOS/posix/gjbext/gjb_interrupt.c18
-rw-r--r--SylixOS/posix/gjbext/gjb_timerel.c15
6 files changed, 41 insertions, 16 deletions
diff --git a/SylixOS/config/gjb/gjb_cfg.h b/SylixOS/config/gjb/gjb_cfg.h
index 2736bc2..045c11a 100644
--- a/SylixOS/config/gjb/gjb_cfg.h
+++ b/SylixOS/config/gjb/gjb_cfg.h
@@ -28,7 +28,7 @@
*********************************************************************************************************/
#define LW_CFG_GJB7714_EN 1 /* 是否提供 GJB7714 支持 */
-#define LW_CFG_GJB7714_INT_EN 0 /* 是否提供 GJB7714 中断接口 */
+#define LW_CFG_GJB7714_INT_EN 1 /* 是否提供 GJB7714 中断接口 */
#endif /* __GJB_CFG_H */
/*********************************************************************************************************
diff --git a/SylixOS/config/kernel/kernel_cfg.h b/SylixOS/config/kernel/kernel_cfg.h
index 39525bb..8174b1f 100644
--- a/SylixOS/config/kernel/kernel_cfg.h
+++ b/SylixOS/config/kernel/kernel_cfg.h
@@ -72,7 +72,7 @@
* 依存关系: 无
*********************************************************************************************************/
-#define LW_CFG_INTER_MEASURE_HOOK_EN 0 /* 是否允许系统中断测量接口 (不需要请关闭) */
+#define LW_CFG_INTER_MEASURE_HOOK_EN 1 /* 是否允许系统中断测量接口 (不需要请关闭) */
/*********************************************************************************************************
* 系统跟踪与监控管理
diff --git a/SylixOS/kernel/include/k_globalvar.h b/SylixOS/kernel/include/k_globalvar.h
index 9b05fc3..740a091 100644
--- a/SylixOS/kernel/include/k_globalvar.h
+++ b/SylixOS/kernel/include/k_globalvar.h
@@ -50,6 +50,7 @@
*********************************************************************************************************/
__KERNEL_EXT VOIDFUNCPTR _K_pfuncKernelDebugLog; /* 内核调试信息 */
__KERNEL_EXT VOIDFUNCPTR _K_pfuncKernelDebugError; /* 内核错误信息 */
+__KERNEL_EXT VOIDFUNCPTR _K_pfuncKernelExc;
/*********************************************************************************************************
HOOK TABLE
*********************************************************************************************************/
diff --git a/SylixOS/kernel/vmm/vmmAbort.c b/SylixOS/kernel/vmm/vmmAbort.c
index 042daa2..aba7d93 100644
--- a/SylixOS/kernel/vmm/vmmAbort.c
+++ b/SylixOS/kernel/vmm/vmmAbort.c
@@ -972,13 +972,18 @@ static VOID __vmmAbortAccess (PLW_VMM_PAGE_FAIL_CTX pvmpagefailctx)
break;
default:
- printk(KERN_EMERG "ACCESS ERROR: abort in thread %lx[%s]. "
- "ret_addr: 0x%08lx abt_addr: 0x%08lx, abt_type: %s.\n",
- pvmpagefailctx->PAGEFCTX_ptcb->TCB_ulId,
- pvmpagefailctx->PAGEFCTX_ptcb->TCB_cThreadName,
- pvmpagefailctx->PAGEFCTX_ulRetAddr,
- pvmpagefailctx->PAGEFCTX_ulAbortAddr,
- __vmmAbortTypeStr(&pvmpagefailctx->PAGEFCTX_abtInfo)); /* 操作异常 */
+ if (_K_pfuncKernelExc) {
+ ((VOID(*)(INT))_K_pfuncKernelExc)(pabtctx->ABTCTX_abtInfo.VMABT_uiType);
+
+ } else {
+ printk(KERN_EMERG "ACCESS ERROR: abort in thread %lx[%s]. "
+ "ret_addr: 0x%08lx abt_addr: 0x%08lx, abt_type: %s.\n",
+ pabtctx->ABTCTX_ptcb->TCB_ulId,
+ pabtctx->ABTCTX_ptcb->TCB_cThreadName,
+ pabtctx->ABTCTX_ulRetAddr,
+ pabtctx->ABTCTX_ulAbortAddr,
+ __vmmAbortTypeStr(&pabtctx->ABTCTX_abtInfo)); /* 操作异常 */
+ }
break;
}
#endif /* LW_CFG_ABORT_BASIC_INFO_EN */
diff --git a/SylixOS/posix/gjbext/gjb_interrupt.c b/SylixOS/posix/gjbext/gjb_interrupt.c
index 8237893..a292dbf 100644
--- a/SylixOS/posix/gjbext/gjb_interrupt.c
+++ b/SylixOS/posix/gjbext/gjb_interrupt.c
@@ -189,10 +189,20 @@ int int_uninstall_handler (int vecnum)
LW_API
EXC_HANDLER exception_handler_set (EXC_HANDLER exc_handler)
{
- (VOID)exc_handler;
-
- errno = ENOSYS;
- return (LW_NULL);
+ EXC_HANDLER old_exc_handler;
+ INTREG iregInterLevel;
+
+ if (getpid() > 0) {
+ errno = EACCES;
+ return (LW_NULL);
+ }
+
+ LW_SPIN_KERN_LOCK_QUICK(&iregInterLevel);
+ old_exc_handler = (EXC_HANDLER)_K_pfuncKernelExc;
+ _K_pfuncKernelExc = (VOIDFUNCPTR)exc_handler;
+ LW_SPIN_KERN_UNLOCK_QUICK(iregInterLevel);
+
+ return (old_exc_handler);
}
/*********************************************************************************************************
** 函数名称: shared_int_install
diff --git a/SylixOS/posix/gjbext/gjb_timerel.c b/SylixOS/posix/gjbext/gjb_timerel.c
index 9155288..f78e42c 100644
--- a/SylixOS/posix/gjbext/gjb_timerel.c
+++ b/SylixOS/posix/gjbext/gjb_timerel.c
@@ -51,7 +51,11 @@ uint64_t tick_get (void)
LW_API
void tick_set (uint64_t ticks)
{
- errno = ENOTSUP;
+ INTREG iregInterLevel;
+
+ LW_SPIN_KERN_LOCK_QUICK(&iregInterLevel);
+ _K_atomic64KernelTime.counter = ticks;
+ LW_SPIN_KERN_UNLOCK_QUICK(iregInterLevel);
}
/*********************************************************************************************************
** 函数名称: sys_clk_rate_get
@@ -79,8 +83,13 @@ uint32_t sys_clk_rate_get (void)
LW_API
int sys_clk_rate_set (int ticks_per_second)
{
- errno = ENOTSUP;
- return (PX_ERROR);
+ INTREG iregInterLevel;
+
+ LW_SPIN_KERN_LOCK_QUICK(&iregInterLevel);
+ LW_TICK_HZ = ticks_per_second;
+ LW_SPIN_KERN_UNLOCK_QUICK(iregInterLevel);
+
+ return (ERROR_NONE);
}
/*********************************************************************************************************
** 函数名称: wdg_create