Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
ea0af95b
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
ea0af95b
编写于
1月 25, 2008
作者:
J
Jesper Nilsson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
CRIS v32: Change lib/spinlock.S to use byte operations instead of dwords.
上级
ea402db9
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
5 addition
and
143 deletion
+5
-143
arch/cris/arch-v32/kernel/vcs_hook.c
arch/cris/arch-v32/kernel/vcs_hook.c
+0
-96
arch/cris/arch-v32/kernel/vcs_hook.h
arch/cris/arch-v32/kernel/vcs_hook.h
+0
-42
arch/cris/arch-v32/lib/spinlock.S
arch/cris/arch-v32/lib/spinlock.S
+5
-5
未找到文件。
arch/cris/arch-v32/kernel/vcs_hook.c
已删除
100644 → 0
浏览文件 @
ea402db9
// $Id: vcs_hook.c,v 1.2 2003/08/12 12:01:06 starvik Exp $
//
// Call simulator hook. This is the part running in the
// simulated program.
//
#include "vcs_hook.h"
#include <stdarg.h>
#include <asm/arch-v32/hwregs/reg_map.h>
#include <asm/arch-v32/hwregs/intr_vect_defs.h>
#define HOOK_TRIG_ADDR 0xb7000000
/* hook cvlog model reg address */
#define HOOK_MEM_BASE_ADDR 0xa0000000
/* csp4 (shared mem) base addr */
#define HOOK_DATA(offset) ((unsigned*) HOOK_MEM_BASE_ADDR)[offset]
#define VHOOK_DATA(offset) ((volatile unsigned*) HOOK_MEM_BASE_ADDR)[offset]
#define HOOK_TRIG(funcid) do { *((unsigned *) HOOK_TRIG_ADDR) = funcid; } while(0)
#define HOOK_DATA_BYTE(offset) ((unsigned char*) HOOK_MEM_BASE_ADDR)[offset]
// ------------------------------------------------------------------ hook_call
int
hook_call
(
unsigned
id
,
unsigned
pcnt
,
...)
{
va_list
ap
;
unsigned
i
;
unsigned
ret
;
#ifdef USING_SOS
PREEMPT_OFF_SAVE
();
#endif
// pass parameters
HOOK_DATA
(
0
)
=
id
;
/* Have to make hook_print_str a special case since we call with a
parameter of byte type. Should perhaps be a separate
hook_call. */
if
(
id
==
hook_print_str
)
{
int
i
;
char
*
str
;
HOOK_DATA
(
1
)
=
pcnt
;
va_start
(
ap
,
pcnt
);
str
=
(
char
*
)
va_arg
(
ap
,
unsigned
);
for
(
i
=
0
;
i
!=
pcnt
;
i
++
)
{
HOOK_DATA_BYTE
(
8
+
i
)
=
str
[
i
];
}
HOOK_DATA_BYTE
(
8
+
i
)
=
0
;
/* null byte */
}
else
{
va_start
(
ap
,
pcnt
);
for
(
i
=
1
;
i
<=
pcnt
;
i
++
)
HOOK_DATA
(
i
)
=
va_arg
(
ap
,
unsigned
);
va_end
(
ap
);
}
// read from mem to make sure data has propagated to memory before trigging
*
((
volatile
unsigned
*
)
HOOK_MEM_BASE_ADDR
);
// trigger hook
HOOK_TRIG
(
id
);
// wait for call to finish
while
(
VHOOK_DATA
(
0
)
>
0
)
{}
// extract return value
ret
=
VHOOK_DATA
(
1
);
#ifdef USING_SOS
PREEMPT_RESTORE
();
#endif
return
ret
;
}
unsigned
hook_buf
(
unsigned
i
)
{
return
(
HOOK_DATA
(
i
));
}
void
print_str
(
const
char
*
str
)
{
int
i
;
for
(
i
=
1
;
str
[
i
];
i
++
);
/* find null at end of string */
hook_call
(
hook_print_str
,
i
,
str
);
}
// --------------------------------------------------------------- CPU_KICK_DOG
void
CPU_KICK_DOG
(
void
)
{
(
void
)
hook_call
(
hook_kick_dog
,
0
);
}
// ------------------------------------------------------- CPU_WATCHDOG_TIMEOUT
void
CPU_WATCHDOG_TIMEOUT
(
unsigned
t
)
{
(
void
)
hook_call
(
hook_dog_timeout
,
1
,
t
);
}
arch/cris/arch-v32/kernel/vcs_hook.h
已删除
100644 → 0
浏览文件 @
ea402db9
// $Id: vcs_hook.h,v 1.1 2003/08/12 12:01:06 starvik Exp $
//
// Call simulator hook functions
#ifndef HOOK_H
#define HOOK_H
int
hook_call
(
unsigned
id
,
unsigned
pcnt
,
...);
enum
hook_ids
{
hook_debug_on
=
1
,
hook_debug_off
,
hook_stop_sim_ok
,
hook_stop_sim_fail
,
hook_alloc_shared
,
hook_ptr_shared
,
hook_free_shared
,
hook_file2shared
,
hook_cmp_shared
,
hook_print_params
,
hook_sim_time
,
hook_stop_sim
,
hook_kick_dog
,
hook_dog_timeout
,
hook_rand
,
hook_srand
,
hook_rand_range
,
hook_print_str
,
hook_print_hex
,
hook_cmp_offset_shared
,
hook_fill_random_shared
,
hook_alloc_random_data
,
hook_calloc_random_data
,
hook_print_int
,
hook_print_uint
,
hook_fputc
,
hook_init_fd
,
hook_sbrk
};
#endif
arch/cris/arch-v32/lib/spinlock.S
浏览文件 @
ea0af95b
...
...
@@ -12,11 +12,11 @@
cris_spin_lock
:
clearf
p
1
:
test.
d
[
$r10
]
1
:
test.
b
[
$r10
]
beq
1
b
clearf
p
ax
clear.
d
[
$r10
]
clear.
b
[
$r10
]
bcs
1
b
clearf
p
ret
...
...
@@ -24,10 +24,10 @@ cris_spin_lock:
cris_spin_trylock
:
clearf
p
1
:
move.
d
[
$r10
],
$r11
1
:
move.
b
[
$r10
],
$r11
ax
clear.
d
[
$r10
]
clear.
b
[
$r10
]
bcs
1
b
clearf
p
ret
mov
e.d
$r11
,
$r10
mov
u.b
$r11
,
$r10
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录