Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2301_76519099
rt-thread
提交
f5b0bfd3
R
rt-thread
项目概览
2301_76519099
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
3
Star
1
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f5b0bfd3
编写于
4月 20, 2022
作者:
xiaozhao86
提交者:
guo
4月 20, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
uniform code writing-disable interrupt
上级
5fa15a19
变更
47
展开全部
隐藏空白更改
内联
并排
Showing
47 changed file
with
293 addition
and
290 deletion
+293
-290
components/drivers/audio/audio_pipe.c
components/drivers/audio/audio_pipe.c
+2
-2
components/drivers/ipc/dataqueue.c
components/drivers/ipc/dataqueue.c
+6
-6
components/drivers/pm/pm.c
components/drivers/pm/pm.c
+7
-7
components/drivers/spi/enc28j60.c
components/drivers/spi/enc28j60.c
+1
-1
components/drivers/usb/usbdevice/class/cdc_vcom.c
components/drivers/usb/usbdevice/class/cdc_vcom.c
+8
-8
components/finsh/cmd.c
components/finsh/cmd.c
+11
-11
components/finsh/shell.c
components/finsh/shell.c
+1
-1
components/libc/compilers/common/time.c
components/libc/compilers/common/time.c
+4
-4
components/libc/cplusplus/cpp11/atomic_8.c
components/libc/cplusplus/cpp11/atomic_8.c
+5
-5
components/libc/posix/io/aio/aio.c
components/libc/posix/io/aio/aio.c
+7
-6
components/net/at/src/at_cli.c
components/net/at/src/at_cli.c
+16
-16
components/net/lwip/port/ethernetif.c
components/net/lwip/port/ethernetif.c
+1
-2
components/utilities/ymodem/ymodem.c
components/utilities/ymodem/ymodem.c
+10
-10
components/vbus/prio_queue.c
components/vbus/prio_queue.c
+4
-4
components/vbus/vbus.c
components/vbus/vbus.c
+14
-14
components/vbus/watermark_queue.h
components/vbus/watermark_queue.h
+9
-9
components/vmm/vmm.c
components/vmm/vmm.c
+1
-1
libcpu/aarch64/common/cpu.c
libcpu/aarch64/common/cpu.c
+1
-1
libcpu/aarch64/common/mmu.c
libcpu/aarch64/common/mmu.c
+1
-1
libcpu/arm/am335x/cpu.c
libcpu/arm/am335x/cpu.c
+1
-1
libcpu/arm/arm926/cpuport.c
libcpu/arm/arm926/cpuport.c
+1
-1
libcpu/arm/armv6/cpuport.c
libcpu/arm/armv6/cpuport.c
+1
-1
libcpu/arm/cortex-a/cpu.c
libcpu/arm/cortex-a/cpu.c
+1
-1
libcpu/arm/dm36x/cpuport.c
libcpu/arm/dm36x/cpuport.c
+1
-1
libcpu/arm/realview-a8-vmm/cpu.c
libcpu/arm/realview-a8-vmm/cpu.c
+1
-1
libcpu/arm/s3c24x0/cpu.c
libcpu/arm/s3c24x0/cpu.c
+1
-1
libcpu/arm/sep4020/cpu.c
libcpu/arm/sep4020/cpu.c
+6
-4
libcpu/arm/zynqmp-r5/cpu.c
libcpu/arm/zynqmp-r5/cpu.c
+1
-1
libcpu/mips/common/exception.c
libcpu/mips/common/exception.c
+1
-1
libcpu/mips/gs264/mmu.c
libcpu/mips/gs264/mmu.c
+2
-1
libcpu/ppc/ppc405/interrupt.c
libcpu/ppc/ppc405/interrupt.c
+3
-3
libcpu/risc-v/ch32v1/cpuport.c
libcpu/risc-v/ch32v1/cpuport.c
+2
-2
libcpu/risc-v/common/cpuport.c
libcpu/risc-v/common/cpuport.c
+1
-1
libcpu/risc-v/nuclei/cpuport.c
libcpu/risc-v/nuclei/cpuport.c
+1
-1
libcpu/risc-v/t-head/e9xx/cpuport.c
libcpu/risc-v/t-head/e9xx/cpuport.c
+1
-1
libcpu/risc-v/virt64/cpuport.c
libcpu/risc-v/virt64/cpuport.c
+1
-1
libcpu/unicore32/sep6200/cpu.c
libcpu/unicore32/sep6200/cpu.c
+1
-1
src/cpu.c
src/cpu.c
+2
-2
src/idle.c
src/idle.c
+5
-5
src/ipc.c
src/ipc.c
+83
-83
src/mem.c
src/mem.c
+1
-1
src/mempool.c
src/mempool.c
+4
-4
src/object.c
src/object.c
+14
-14
src/scheduler.c
src/scheduler.c
+11
-11
src/signal.c
src/signal.c
+2
-2
src/thread.c
src/thread.c
+27
-27
src/timer.c
src/timer.c
+8
-8
未找到文件。
components/drivers/audio/audio_pipe.c
浏览文件 @
f5b0bfd3
...
...
@@ -37,7 +37,7 @@ static rt_size_t rt_pipe_read(rt_device_t dev,
void
*
buffer
,
rt_size_t
size
)
{
rt_
uint32
_t
level
;
rt_
base
_t
level
;
rt_thread_t
thread
;
struct
rt_audio_pipe
*
pipe
;
rt_size_t
read_nbytes
;
...
...
@@ -119,7 +119,7 @@ static rt_size_t rt_pipe_write(rt_device_t dev,
const
void
*
buffer
,
rt_size_t
size
)
{
rt_
uint32
_t
level
;
rt_
base
_t
level
;
rt_thread_t
thread
;
struct
rt_audio_pipe
*
pipe
;
rt_size_t
write_nbytes
;
...
...
components/drivers/ipc/dataqueue.c
浏览文件 @
f5b0bfd3
...
...
@@ -91,7 +91,7 @@ rt_err_t rt_data_queue_push(struct rt_data_queue *queue,
rt_size_t
data_size
,
rt_int32_t
timeout
)
{
rt_
ubase_t
level
;
rt_
base_t
level
;
rt_thread_t
thread
;
rt_err_t
result
;
...
...
@@ -208,7 +208,7 @@ rt_err_t rt_data_queue_pop(struct rt_data_queue *queue,
rt_size_t
*
size
,
rt_int32_t
timeout
)
{
rt_
ubase_t
level
;
rt_
base_t
level
;
rt_thread_t
thread
;
rt_err_t
result
;
...
...
@@ -330,7 +330,7 @@ rt_err_t rt_data_queue_peek(struct rt_data_queue *queue,
const
void
**
data_ptr
,
rt_size_t
*
size
)
{
rt_
ubase_t
level
;
rt_
base_t
level
;
RT_ASSERT
(
queue
!=
RT_NULL
);
RT_ASSERT
(
queue
->
magic
==
DATAQUEUE_MAGIC
);
...
...
@@ -361,7 +361,7 @@ RTM_EXPORT(rt_data_queue_peek);
*/
void
rt_data_queue_reset
(
struct
rt_data_queue
*
queue
)
{
rt_
ubase_t
level
;
rt_
base_t
level
;
struct
rt_thread
*
thread
;
RT_ASSERT
(
queue
!=
RT_NULL
);
...
...
@@ -441,7 +441,7 @@ RTM_EXPORT(rt_data_queue_reset);
*/
rt_err_t
rt_data_queue_deinit
(
struct
rt_data_queue
*
queue
)
{
rt_
u
base_t
level
;
rt_base_t
level
;
RT_ASSERT
(
queue
!=
RT_NULL
);
RT_ASSERT
(
queue
->
magic
==
DATAQUEUE_MAGIC
);
...
...
@@ -468,7 +468,7 @@ RTM_EXPORT(rt_data_queue_deinit);
*/
rt_uint16_t
rt_data_queue_len
(
struct
rt_data_queue
*
queue
)
{
rt_
u
base_t
level
;
rt_base_t
level
;
rt_int16_t
len
;
RT_ASSERT
(
queue
!=
RT_NULL
);
...
...
components/drivers/pm/pm.c
浏览文件 @
f5b0bfd3
...
...
@@ -510,7 +510,7 @@ void rt_pm_request(rt_uint8_t mode)
*/
void
rt_pm_release
(
rt_uint8_t
mode
)
{
rt_
u
base_t
level
;
rt_base_t
level
;
struct
rt_pm
*
pm
;
if
(
_pm_init_flag
==
0
)
...
...
@@ -535,7 +535,7 @@ void rt_pm_release(rt_uint8_t mode)
*/
void
rt_pm_release_all
(
rt_uint8_t
mode
)
{
rt_
u
base_t
level
;
rt_base_t
level
;
struct
rt_pm
*
pm
;
if
(
_pm_init_flag
==
0
)
...
...
@@ -589,7 +589,7 @@ void rt_pm_module_request(uint8_t module_id, rt_uint8_t mode)
*/
void
rt_pm_module_release
(
uint8_t
module_id
,
rt_uint8_t
mode
)
{
rt_
u
base_t
level
;
rt_base_t
level
;
struct
rt_pm
*
pm
;
if
(
_pm_init_flag
==
0
)
...
...
@@ -620,7 +620,7 @@ void rt_pm_module_release(uint8_t module_id, rt_uint8_t mode)
*/
void
rt_pm_module_release_all
(
uint8_t
module_id
,
rt_uint8_t
mode
)
{
rt_
u
base_t
level
;
rt_base_t
level
;
struct
rt_pm
*
pm
;
if
(
_pm_init_flag
==
0
)
...
...
@@ -646,7 +646,7 @@ void rt_pm_module_release_all(uint8_t module_id, rt_uint8_t mode)
*/
void
rt_pm_sleep_request
(
rt_uint16_t
module_id
,
rt_uint8_t
mode
)
{
rt_
uint32
_t
level
;
rt_
base
_t
level
;
if
(
module_id
>=
PM_MODULE_MAX_ID
)
{
...
...
@@ -709,7 +709,7 @@ void rt_pm_sleep_light_request(rt_uint16_t module_id)
*/
void
rt_pm_sleep_release
(
rt_uint16_t
module_id
,
rt_uint8_t
mode
)
{
rt_
uint32
_t
level
;
rt_
base
_t
level
;
if
(
module_id
>=
PM_MODULE_MAX_ID
)
{
...
...
@@ -797,7 +797,7 @@ void rt_pm_device_register(struct rt_device *device, const struct rt_device_pm_o
*/
void
rt_pm_device_unregister
(
struct
rt_device
*
device
)
{
rt_
u
base_t
level
;
rt_base_t
level
;
rt_uint32_t
index
;
RT_DEBUG_NOT_IN_INTERRUPT
;
...
...
components/drivers/spi/enc28j60.c
浏览文件 @
f5b0bfd3
...
...
@@ -85,7 +85,7 @@ static uint8_t spi_read_op(struct rt_spi_device *spi_device, uint8_t op, uint8_t
static
void
spi_write_op
(
struct
rt_spi_device
*
spi_device
,
uint8_t
op
,
uint8_t
address
,
uint8_t
data
)
{
uint32
_t
level
;
rt_base
_t
level
;
uint8_t
buffer
[
2
];
level
=
rt_hw_interrupt_disable
();
...
...
components/drivers/usb/usbdevice/class/cdc_vcom.c
浏览文件 @
f5b0bfd3
...
...
@@ -257,17 +257,17 @@ static void rt_usb_vcom_init(struct ufunction *func);
static
void
_vcom_reset_state
(
ufunction_t
func
)
{
struct
vcom
*
data
;
int
lv
l
;
rt_base_t
leve
l
;
RT_ASSERT
(
func
!=
RT_NULL
)
data
=
(
struct
vcom
*
)
func
->
user_data
;
l
v
l
=
rt_hw_interrupt_disable
();
l
eve
l
=
rt_hw_interrupt_disable
();
data
->
connected
=
RT_FALSE
;
data
->
in_sending
=
RT_FALSE
;
/*rt_kprintf("reset USB serial\n", cnt);*/
rt_hw_interrupt_enable
(
l
v
l
);
rt_hw_interrupt_enable
(
l
eve
l
);
}
/**
...
...
@@ -320,7 +320,7 @@ static rt_err_t _ep_in_handler(ufunction_t func, rt_size_t size)
*/
static
rt_err_t
_ep_out_handler
(
ufunction_t
func
,
rt_size_t
size
)
{
rt_
uint32
_t
level
;
rt_
base
_t
level
;
struct
vcom
*
data
;
RT_ASSERT
(
func
!=
RT_NULL
);
...
...
@@ -687,7 +687,7 @@ static int _vcom_getc(struct rt_serial_device *serial)
{
int
result
;
rt_uint8_t
ch
;
rt_
uint32
_t
level
;
rt_
base
_t
level
;
struct
ufunction
*
func
;
struct
vcom
*
data
;
...
...
@@ -710,7 +710,7 @@ static int _vcom_getc(struct rt_serial_device *serial)
static
rt_size_t
_vcom_rb_block_put
(
struct
vcom
*
data
,
const
rt_uint8_t
*
buf
,
rt_size_t
size
)
{
rt_
uint32
_t
level
;
rt_
base
_t
level
;
rt_size_t
put_len
=
0
;
rt_size_t
w_ptr
=
0
;
rt_uint32_t
res
;
...
...
@@ -799,7 +799,7 @@ static rt_size_t _vcom_tx(struct rt_serial_device *serial, rt_uint8_t *buf, rt_s
}
static
int
_vcom_putc
(
struct
rt_serial_device
*
serial
,
char
c
)
{
rt_
uint32
_t
level
;
rt_
base
_t
level
;
struct
ufunction
*
func
;
struct
vcom
*
data
;
...
...
@@ -838,7 +838,7 @@ static const struct rt_uart_ops usb_vcom_ops =
/* Vcom Tx Thread */
static
void
vcom_tx_thread_entry
(
void
*
parameter
)
{
rt_
uint32
_t
level
;
rt_
base
_t
level
;
rt_uint32_t
res
;
struct
ufunction
*
func
=
(
struct
ufunction
*
)
parameter
;
struct
vcom
*
data
=
(
struct
vcom
*
)
func
->
user_data
;
...
...
components/finsh/cmd.c
浏览文件 @
f5b0bfd3
...
...
@@ -89,7 +89,7 @@ static void list_find_init(list_get_next_t *p, rt_uint8_t type, rt_list_t **arra
static
rt_list_t
*
list_get_next
(
rt_list_t
*
current
,
list_get_next_t
*
arg
)
{
int
first_flag
=
0
;
rt_
u
base_t
level
;
rt_base_t
level
;
rt_list_t
*
node
,
*
list
;
rt_list_t
**
array
;
int
nr
;
...
...
@@ -153,7 +153,7 @@ static rt_list_t *list_get_next(rt_list_t *current, list_get_next_t *arg)
long
list_thread
(
void
)
{
rt_
u
base_t
level
;
rt_base_t
level
;
list_get_next_t
find_arg
;
rt_list_t
*
obj_list
[
LIST_FIND_OBJ_NR
];
rt_list_t
*
next
=
(
rt_list_t
*
)
RT_NULL
;
...
...
@@ -267,7 +267,7 @@ static void show_wait_queue(struct rt_list_node *list)
#ifdef RT_USING_SEMAPHORE
long
list_sem
(
void
)
{
rt_
u
base_t
level
;
rt_base_t
level
;
list_get_next_t
find_arg
;
rt_list_t
*
obj_list
[
LIST_FIND_OBJ_NR
];
rt_list_t
*
next
=
(
rt_list_t
*
)
RT_NULL
;
...
...
@@ -334,7 +334,7 @@ MSH_CMD_EXPORT(list_sem, list semaphore in system);
#ifdef RT_USING_EVENT
long
list_event
(
void
)
{
rt_
u
base_t
level
;
rt_base_t
level
;
list_get_next_t
find_arg
;
rt_list_t
*
obj_list
[
LIST_FIND_OBJ_NR
];
rt_list_t
*
next
=
(
rt_list_t
*
)
RT_NULL
;
...
...
@@ -399,7 +399,7 @@ MSH_CMD_EXPORT(list_event, list event in system);
#ifdef RT_USING_MUTEX
long
list_mutex
(
void
)
{
rt_
u
base_t
level
;
rt_base_t
level
;
list_get_next_t
find_arg
;
rt_list_t
*
obj_list
[
LIST_FIND_OBJ_NR
];
rt_list_t
*
next
=
(
rt_list_t
*
)
RT_NULL
;
...
...
@@ -457,7 +457,7 @@ MSH_CMD_EXPORT(list_mutex, list mutex in system);
#ifdef RT_USING_MAILBOX
long
list_mailbox
(
void
)
{
rt_
u
base_t
level
;
rt_base_t
level
;
list_get_next_t
find_arg
;
rt_list_t
*
obj_list
[
LIST_FIND_OBJ_NR
];
rt_list_t
*
next
=
(
rt_list_t
*
)
RT_NULL
;
...
...
@@ -528,7 +528,7 @@ MSH_CMD_EXPORT(list_mailbox, list mail box in system);
#ifdef RT_USING_MESSAGEQUEUE
long
list_msgqueue
(
void
)
{
rt_
u
base_t
level
;
rt_base_t
level
;
list_get_next_t
find_arg
;
rt_list_t
*
obj_list
[
LIST_FIND_OBJ_NR
];
rt_list_t
*
next
=
(
rt_list_t
*
)
RT_NULL
;
...
...
@@ -595,7 +595,7 @@ MSH_CMD_EXPORT(list_msgqueue, list message queue in system);
#ifdef RT_USING_MEMHEAP
long
list_memheap
(
void
)
{
rt_
u
base_t
level
;
rt_base_t
level
;
list_get_next_t
find_arg
;
rt_list_t
*
obj_list
[
LIST_FIND_OBJ_NR
];
rt_list_t
*
next
=
(
rt_list_t
*
)
RT_NULL
;
...
...
@@ -652,7 +652,7 @@ MSH_CMD_EXPORT(list_memheap, list memory heap in system);
#ifdef RT_USING_MEMPOOL
long
list_mempool
(
void
)
{
rt_
u
base_t
level
;
rt_base_t
level
;
list_get_next_t
find_arg
;
rt_list_t
*
obj_list
[
LIST_FIND_OBJ_NR
];
rt_list_t
*
next
=
(
rt_list_t
*
)
RT_NULL
;
...
...
@@ -731,7 +731,7 @@ MSH_CMD_EXPORT(list_mempool, list memory pool in system);
long
list_timer
(
void
)
{
rt_
u
base_t
level
;
rt_base_t
level
;
list_get_next_t
find_arg
;
rt_list_t
*
obj_list
[
LIST_FIND_OBJ_NR
];
rt_list_t
*
next
=
(
rt_list_t
*
)
RT_NULL
;
...
...
@@ -829,7 +829,7 @@ static char *const device_type_str[RT_Device_Class_Unknown] =
long
list_device
(
void
)
{
rt_
u
base_t
level
;
rt_base_t
level
;
list_get_next_t
find_arg
;
rt_list_t
*
obj_list
[
LIST_FIND_OBJ_NR
];
rt_list_t
*
next
=
(
rt_list_t
*
)
RT_NULL
;
...
...
components/finsh/shell.c
浏览文件 @
f5b0bfd3
...
...
@@ -293,7 +293,7 @@ rt_uint32_t finsh_get_echo()
*/
rt_err_t
finsh_set_password
(
const
char
*
password
)
{
rt_
u
base_t
level
;
rt_base_t
level
;
rt_size_t
pw_len
=
rt_strlen
(
password
);
if
(
pw_len
<
FINSH_PASSWORD_MIN
||
pw_len
>
FINSH_PASSWORD_MAX
)
...
...
components/libc/compilers/common/time.c
浏览文件 @
f5b0bfd3
...
...
@@ -505,7 +505,7 @@ RTM_EXPORT(nanosleep);
static
volatile
struct
timeval
_timevalue
;
static
int
_rt_clock_time_system_init
(
void
)
{
r
egister
r
t_base_t
level
;
rt_base_t
level
;
time_t
time
=
0
;
rt_tick_t
tick
;
rt_device_t
device
;
...
...
@@ -593,7 +593,7 @@ int clock_gettime(clockid_t clockid, struct timespec *tp)
case
CLOCK_REALTIME
:
{
int
tick
;
r
egister
r
t_base_t
level
;
rt_base_t
level
;
level
=
rt_hw_interrupt_disable
();
tick
=
rt_tick_get
();
/* get tick */
...
...
@@ -644,7 +644,7 @@ int clock_settime(clockid_t clockid, const struct timespec *tp)
LOG_W
(
_WARNING_NO_RTC
);
return
-
1
;
#else
r
egister
r
t_base_t
level
;
rt_base_t
level
;
int
second
;
rt_tick_t
tick
;
rt_device_t
device
;
...
...
@@ -986,7 +986,7 @@ static volatile int8_t _current_timezone = RT_LIBC_DEFAULT_TIMEZONE;
void
tz_set
(
int8_t
tz
)
{
r
egister
r
t_base_t
level
;
rt_base_t
level
;
level
=
rt_hw_interrupt_disable
();
_current_timezone
=
tz
;
rt_hw_interrupt_enable
(
level
);
...
...
components/libc/cplusplus/cpp11/atomic_8.c
浏览文件 @
f5b0bfd3
...
...
@@ -19,7 +19,7 @@
uint64_t
__atomic_load_8
(
volatile
void
*
ptr
,
int
memorder
)
{
volatile
uint64_t
*
val_ptr
=
(
volatile
uint64_t
*
)
ptr
;
r
egister
r
t_base_t
level
;
rt_base_t
level
;
uint64_t
tmp
;
level
=
rt_hw_interrupt_disable
();
tmp
=
*
val_ptr
;
...
...
@@ -30,7 +30,7 @@ uint64_t __atomic_load_8(volatile void *ptr, int memorder)
void
__atomic_store_8
(
volatile
void
*
ptr
,
uint64_t
val
,
int
memorder
)
{
volatile
uint64_t
*
val_ptr
=
(
volatile
uint64_t
*
)
ptr
;
r
egister
r
t_base_t
level
;
rt_base_t
level
;
level
=
rt_hw_interrupt_disable
();
*
val_ptr
=
val
;
rt_hw_interrupt_enable
(
level
);
...
...
@@ -39,7 +39,7 @@ void __atomic_store_8(volatile void *ptr, uint64_t val, int memorder)
uint64_t
__atomic_exchange_8
(
volatile
void
*
ptr
,
uint64_t
val
,
int
memorder
)
{
volatile
uint64_t
*
val_ptr
=
(
volatile
uint64_t
*
)
ptr
;
r
egister
r
t_base_t
level
;
rt_base_t
level
;
uint64_t
tmp
;
level
=
rt_hw_interrupt_disable
();
tmp
=
*
val_ptr
;
...
...
@@ -52,7 +52,7 @@ bool __atomic_compare_exchange_8(volatile void *ptr, volatile void *expected, ui
{
volatile
uint64_t
*
val_ptr
=
(
volatile
uint64_t
*
)
ptr
;
volatile
uint64_t
*
expected_ptr
=
(
volatile
uint64_t
*
)
expected
;
r
egister
r
t_base_t
level
;
rt_base_t
level
;
bool
exchanged
;
level
=
rt_hw_interrupt_disable
();
if
(
*
val_ptr
==
*
expected_ptr
)
...
...
@@ -72,7 +72,7 @@ bool __atomic_compare_exchange_8(volatile void *ptr, volatile void *expected, ui
#define __atomic_fetch_op_8(OPNAME, OP) \
uint64_t __atomic_fetch_##OPNAME##_8(volatile void *ptr, uint64_t val, int memorder) {\
volatile uint64_t* val_ptr = (volatile uint64_t*)ptr;\
r
egister r
t_base_t level;\
rt_base_t level;\
uint64_t tmp;\
level = rt_hw_interrupt_disable();\
tmp = *val_ptr;\
...
...
components/libc/posix/io/aio/aio.c
浏览文件 @
f5b0bfd3
...
...
@@ -117,7 +117,7 @@ int aio_error (const struct aiocb *cb)
static
void
aio_fync_work
(
struct
rt_work
*
work
,
void
*
work_data
)
{
int
result
;
rt_
u
base_t
level
;
rt_base_t
level
;
struct
aiocb
*
cb
=
(
struct
aiocb
*
)
work_data
;
RT_ASSERT
(
cb
!=
RT_NULL
);
...
...
@@ -136,7 +136,7 @@ static void aio_fync_work(struct rt_work* work, void* work_data)
int
aio_fsync
(
int
op
,
struct
aiocb
*
cb
)
{
rt_
u
base_t
level
;
rt_base_t
level
;
if
(
!
cb
)
return
-
EINVAL
;
level
=
rt_hw_interrupt_disable
();
...
...
@@ -152,7 +152,7 @@ int aio_fsync(int op, struct aiocb *cb)
static
void
aio_read_work
(
struct
rt_work
*
work
,
void
*
work_data
)
{
int
len
;
rt_
u
base_t
level
;
rt_base_t
level
;
uint8_t
*
buf_ptr
;
struct
aiocb
*
cb
=
(
struct
aiocb
*
)
work_data
;
...
...
@@ -222,7 +222,7 @@ static void aio_read_work(struct rt_work* work, void* work_data)
*/
int
aio_read
(
struct
aiocb
*
cb
)
{
rt_
u
base_t
level
;
rt_base_t
level
;
if
(
!
cb
)
return
-
EINVAL
;
if
(
cb
->
aio_offset
<
0
)
return
-
EINVAL
;
...
...
@@ -292,7 +292,8 @@ int aio_suspend(const struct aiocb *const list[], int nent,
static
void
aio_write_work
(
struct
rt_work
*
work
,
void
*
work_data
)
{
int
len
,
oflags
,
level
;
rt_base_t
level
;
int
len
,
oflags
;
uint8_t
*
buf_ptr
;
struct
aiocb
*
cb
=
(
struct
aiocb
*
)
work_data
;
...
...
@@ -361,7 +362,7 @@ static void aio_write_work(struct rt_work* work, void* work_data)
int
aio_write
(
struct
aiocb
*
cb
)
{
int
oflags
;
rt_
u
base_t
level
;
rt_base_t
level
;
if
(
!
cb
||
(
cb
->
aio_buf
==
NULL
))
return
-
EINVAL
;
...
...
components/net/at/src/at_cli.c
浏览文件 @
f5b0bfd3
...
...
@@ -59,7 +59,7 @@ static rt_err_t console_getchar_rx_ind(rt_device_t dev, rt_size_t size)
void
at_cli_init
(
void
)
{
rt_base_t
int_lv
l
;
rt_base_t
leve
l
;
rt_device_t
console
;
rt_sem_init
(
&
console_rx_notice
,
"cli_c"
,
0
,
RT_IPC_FLAG_FIFO
);
...
...
@@ -69,7 +69,7 @@ void at_cli_init(void)
/* created must success */
RT_ASSERT
(
console_rx_fifo
);
int_lv
l
=
rt_hw_interrupt_disable
();
leve
l
=
rt_hw_interrupt_disable
();
console
=
rt_console_get_device
();
if
(
console
)
{
...
...
@@ -78,22 +78,22 @@ void at_cli_init(void)
rt_device_set_rx_indicate
(
console
,
console_getchar_rx_ind
);
}
rt_hw_interrupt_enable
(
int_lv
l
);
rt_hw_interrupt_enable
(
leve
l
);
}
void
at_cli_deinit
(
void
)
{
rt_base_t
int_lv
l
;
rt_base_t
leve
l
;
rt_device_t
console
;
int_lv
l
=
rt_hw_interrupt_disable
();
leve
l
=
rt_hw_interrupt_disable
();
console
=
rt_console_get_device
();
if
(
console
&&
odev_rx_ind
)
{
/* restore RX indicate */
rt_device_set_rx_indicate
(
console
,
odev_rx_ind
);
}
rt_hw_interrupt_enable
(
int_lv
l
);
rt_hw_interrupt_enable
(
leve
l
);
rt_sem_detach
(
&
console_rx_notice
);
rt_ringbuffer_destroy
(
console_rx_fifo
);
...
...
@@ -111,14 +111,14 @@ static void server_cli_parser(void)
extern
at_server_t
at_get_server
(
void
);
at_server_t
server
=
at_get_server
();
rt_base_t
int_lv
l
;
rt_base_t
leve
l
;
static
rt_device_t
device_bak
;
static
rt_err_t
(
*
getchar_bak
)(
struct
at_server
*
server
,
char
*
ch
,
rt_int32_t
timeout
);
static
char
endmark_back
[
AT_END_MARK_LEN
];
/* backup server device and getchar function */
{
int_lv
l
=
rt_hw_interrupt_disable
();
leve
l
=
rt_hw_interrupt_disable
();
device_bak
=
server
->
device
;
getchar_bak
=
server
->
get_char
;
...
...
@@ -133,7 +133,7 @@ static void server_cli_parser(void)
rt_memset
(
server
->
end_mark
,
0x00
,
AT_END_MARK_LEN
);
server
->
end_mark
[
0
]
=
'\r'
;
rt_hw_interrupt_enable
(
int_lv
l
);
rt_hw_interrupt_enable
(
leve
l
);
}
if
(
server
)
...
...
@@ -149,7 +149,7 @@ static void server_cli_parser(void)
/* restore server device and getchar function */
{
int_lv
l
=
rt_hw_interrupt_disable
();
leve
l
=
rt_hw_interrupt_disable
();
server
->
device
=
device_bak
;
server
->
get_char
=
getchar_bak
;
...
...
@@ -157,7 +157,7 @@ static void server_cli_parser(void)
rt_memset
(
server
->
end_mark
,
0x00
,
AT_END_MARK_LEN
);
rt_memcpy
(
server
->
end_mark
,
endmark_back
,
strlen
(
endmark_back
));
rt_hw_interrupt_enable
(
int_lv
l
);
rt_hw_interrupt_enable
(
leve
l
);
}
}
#endif
/* AT_USING_SERVER */
...
...
@@ -211,7 +211,7 @@ static void client_cli_parser(at_client_t client)
char
cur_line
[
FINSH_CMD_SIZE
]
=
{
0
};
rt_size_t
cur_line_len
=
0
;
static
rt_err_t
(
*
client_odev_rx_ind
)(
rt_device_t
dev
,
rt_size_t
size
)
=
RT_NULL
;
rt_base_t
int_lv
l
;
rt_base_t
leve
l
;
rt_thread_t
at_client
;
at_status_t
client_odev_status
;
...
...
@@ -225,10 +225,10 @@ static void client_cli_parser(at_client_t client)
/* backup client device RX indicate */
{
int_lv
l
=
rt_hw_interrupt_disable
();
leve
l
=
rt_hw_interrupt_disable
();
client_odev_rx_ind
=
client
->
device
->
rx_indicate
;
rt_device_set_rx_indicate
(
client
->
device
,
client_getchar_rx_ind
);
rt_hw_interrupt_enable
(
int_lv
l
);
rt_hw_interrupt_enable
(
leve
l
);
}
rt_sem_init
(
&
client_rx_notice
,
"cli_r"
,
0
,
RT_IPC_FLAG_FIFO
);
...
...
@@ -278,9 +278,9 @@ static void client_cli_parser(at_client_t client)
/* restore client device RX indicate */
{
int_lv
l
=
rt_hw_interrupt_disable
();
leve
l
=
rt_hw_interrupt_disable
();
rt_device_set_rx_indicate
(
client
->
device
,
client_odev_rx_ind
);
rt_hw_interrupt_enable
(
int_lv
l
);
rt_hw_interrupt_enable
(
leve
l
);
}
rt_thread_delete
(
at_client
);
...
...
components/net/lwip/port/ethernetif.c
浏览文件 @
f5b0bfd3
...
...
@@ -663,7 +663,7 @@ rt_err_t eth_device_ready(struct eth_device* dev)
rt_err_t
eth_device_linkchange
(
struct
eth_device
*
dev
,
rt_bool_t
up
)
{
rt_
uint32
_t
level
;
rt_
base
_t
level
;
RT_ASSERT
(
dev
!=
RT_NULL
);
...
...
@@ -740,7 +740,6 @@ static void eth_rx_thread_entry(void* parameter)
if
(
device
->
link_changed
)
{
int
status
;
rt_uint32_t
level
;
level
=
rt_hw_interrupt_disable
();
status
=
device
->
link_status
;
...
...
components/utilities/ymodem/ymodem.c
浏览文件 @
f5b0bfd3
...
...
@@ -627,7 +627,7 @@ rt_err_t rym_recv_on_device(
rt_err_t
res
;
rt_err_t
(
*
odev_rx_ind
)(
rt_device_t
dev
,
rt_size_t
size
);
rt_uint16_t
odev_flag
;
int
int_lv
l
;
rt_base_t
leve
l
;
RT_ASSERT
(
_rym_the_ctx
==
0
);
_rym_the_ctx
=
ctx
;
...
...
@@ -641,13 +641,13 @@ rt_err_t rym_recv_on_device(
odev_rx_ind
=
dev
->
rx_indicate
;
/* no data should be received before the device has been fully setted up.
*/
int_lv
l
=
rt_hw_interrupt_disable
();
leve
l
=
rt_hw_interrupt_disable
();
rt_device_set_rx_indicate
(
dev
,
_rym_rx_ind
);
odev_flag
=
dev
->
open_flag
;
/* make sure the device don't change the content. */
dev
->
open_flag
&=
~
RT_DEVICE_FLAG_STREAM
;
rt_hw_interrupt_enable
(
int_lv
l
);
rt_hw_interrupt_enable
(
leve
l
);
res
=
rt_device_open
(
dev
,
oflag
);
if
(
res
!=
RT_EOK
)
...
...
@@ -660,12 +660,12 @@ rt_err_t rym_recv_on_device(
__exit:
/* no rx_ind should be called before the callback has been fully detached.
*/
int_lv
l
=
rt_hw_interrupt_disable
();
leve
l
=
rt_hw_interrupt_disable
();
rt_sem_detach
(
&
ctx
->
sem
);
dev
->
open_flag
=
odev_flag
;
rt_device_set_rx_indicate
(
dev
,
odev_rx_ind
);
rt_hw_interrupt_enable
(
int_lv
l
);
rt_hw_interrupt_enable
(
leve
l
);
_rym_the_ctx
=
RT_NULL
;
...
...
@@ -684,7 +684,7 @@ rt_err_t rym_send_on_device(
rt_err_t
res
=
0
;
rt_err_t
(
*
odev_rx_ind
)(
rt_device_t
dev
,
rt_size_t
size
);
rt_uint16_t
odev_flag
;
int
int_lv
l
;
rt_base_t
leve
l
;
RT_ASSERT
(
_rym_the_ctx
==
0
);
_rym_the_ctx
=
ctx
;
...
...
@@ -698,13 +698,13 @@ rt_err_t rym_send_on_device(
odev_rx_ind
=
dev
->
rx_indicate
;
/* no data should be received before the device has been fully setted up.
*/
int_lv
l
=
rt_hw_interrupt_disable
();
leve
l
=
rt_hw_interrupt_disable
();
rt_device_set_rx_indicate
(
dev
,
_rym_rx_ind
);
odev_flag
=
dev
->
open_flag
;
/* make sure the device don't change the content. */
dev
->
open_flag
&=
~
RT_DEVICE_FLAG_STREAM
;
rt_hw_interrupt_enable
(
int_lv
l
);
rt_hw_interrupt_enable
(
leve
l
);
res
=
rt_device_open
(
dev
,
oflag
);
if
(
res
!=
RT_EOK
)
...
...
@@ -716,12 +716,12 @@ rt_err_t rym_send_on_device(
__exit:
int_lv
l
=
rt_hw_interrupt_disable
();
leve
l
=
rt_hw_interrupt_disable
();
rt_sem_detach
(
&
ctx
->
sem
);
dev
->
open_flag
=
odev_flag
;
rt_device_set_rx_indicate
(
dev
,
odev_rx_ind
);
rt_hw_interrupt_enable
(
int_lv
l
);
rt_hw_interrupt_enable
(
leve
l
);
_rym_the_ctx
=
RT_NULL
;
...
...
components/vbus/prio_queue.c
浏览文件 @
f5b0bfd3
...
...
@@ -86,7 +86,7 @@ void rt_prio_queue_detach(struct rt_prio_queue *que)
rt_thread_t
thread
;
/* disable interrupt */
rt_
ubase_t
temp
=
rt_hw_interrupt_disable
();
rt_
base_t
level
=
rt_hw_interrupt_disable
();
/* get next suspend thread */
thread
=
rt_list_entry
(
que
->
suspended_pop_list
.
next
,
struct
rt_thread
,
tlist
);
...
...
@@ -96,7 +96,7 @@ void rt_prio_queue_detach(struct rt_prio_queue *que)
rt_thread_resume
(
thread
);
/* enable interrupt */
rt_hw_interrupt_enable
(
temp
);
rt_hw_interrupt_enable
(
level
);
}
rt_mp_detach
(
&
que
->
pool
);
}
...
...
@@ -136,7 +136,7 @@ rt_err_t rt_prio_queue_push(struct rt_prio_queue *que,
void
*
data
,
rt_int32_t
timeout
)
{
rt_
u
base_t
level
;
rt_base_t
level
;
struct
rt_prio_queue_item
*
item
;
RT_ASSERT
(
que
);
...
...
@@ -182,7 +182,7 @@ rt_err_t rt_prio_queue_pop(struct rt_prio_queue *que,
void
*
data
,
rt_int32_t
timeout
)
{
rt_
u
base_t
level
;
rt_base_t
level
;
struct
rt_prio_queue_item
*
item
;
RT_ASSERT
(
que
);
...
...
components/vbus/vbus.c
浏览文件 @
f5b0bfd3
...
...
@@ -222,7 +222,7 @@ static void _bus_out_entry(void *param)
/* wait for enough space */
while
(
sp
<
dnr
)
{
rt_
ubase_t
lv
l
=
rt_hw_interrupt_disable
();
rt_
base_t
leve
l
=
rt_hw_interrupt_disable
();
RT_VBUS_OUT_RING
->
blocked
=
1
;
rt_vbus_smp_wmb
();
...
...
@@ -235,7 +235,7 @@ static void _bus_out_entry(void *param)
RT_VBUS_OUT_RING
->
blocked
=
0
;
rt_hw_interrupt_enable
(
l
v
l
);
rt_hw_interrupt_enable
(
l
eve
l
);
sp
=
_bus_ring_space_nr
(
RT_VBUS_OUT_RING
);
}
...
...
@@ -474,11 +474,11 @@ rt_err_t rt_vbus_listen_on(rt_uint8_t chnr,
void
rt_vbus_data_push
(
unsigned
int
id
,
struct
rt_vbus_data
*
act
)
{
rt_
ubase_t
lv
l
;
rt_
base_t
leve
l
;
RT_ASSERT
(
0
<
id
&&
id
<
RT_VBUS_CHANNEL_NR
);
l
v
l
=
rt_hw_interrupt_disable
();
l
eve
l
=
rt_hw_interrupt_disable
();
if
(
_bus_in_action
[
id
][
_IN_ACT_HEAD
]
==
RT_NULL
)
{
...
...
@@ -495,7 +495,7 @@ void rt_vbus_data_push(unsigned int id, struct rt_vbus_data *act)
_bus_in_action_nr
[
id
]
++
;
#endif
rt_hw_interrupt_enable
(
l
v
l
);
rt_hw_interrupt_enable
(
l
eve
l
);
#ifdef RT_VBUS_USING_FLOW_CONTROL
_chn_recv_wm
[
id
].
level
++
;
...
...
@@ -519,11 +519,11 @@ void rt_vbus_data_push(unsigned int id, struct rt_vbus_data *act)
struct
rt_vbus_data
*
rt_vbus_data_pop
(
unsigned
int
id
)
{
struct
rt_vbus_data
*
act
;
rt_
ubase_t
lv
l
;
rt_
base_t
leve
l
;
RT_ASSERT
(
0
<
id
&&
id
<
RT_VBUS_CHANNEL_NR
);
l
v
l
=
rt_hw_interrupt_disable
();
l
eve
l
=
rt_hw_interrupt_disable
();
act
=
_bus_in_action
[
id
][
_IN_ACT_HEAD
];
if
(
act
)
...
...
@@ -531,7 +531,7 @@ struct rt_vbus_data* rt_vbus_data_pop(unsigned int id)
_bus_in_action
[
id
][
_IN_ACT_HEAD
]
=
act
->
next
;
}
rt_hw_interrupt_enable
(
l
v
l
);
rt_hw_interrupt_enable
(
l
eve
l
);
#ifdef RT_VBUS_USING_FLOW_CONTROL
if
(
_chn_recv_wm
[
id
].
level
!=
0
)
...
...
@@ -901,9 +901,9 @@ int rt_vbus_request_chn(struct rt_vbus_request *req,
int
i
,
chnr
,
err
;
size_t
plen
=
rt_strlen
(
req
->
name
)
+
2
;
unsigned
char
*
pbuf
;
rt_
ubase_t
lv
l
;
rt_
base_t
leve
l
;
l
v
l
=
rt_hw_interrupt_disable
();
l
eve
l
=
rt_hw_interrupt_disable
();
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
_sess
);
i
++
)
{
if
(
_sess
[
i
].
st
==
SESSIOM_AVAILABLE
)
...
...
@@ -911,7 +911,7 @@ int rt_vbus_request_chn(struct rt_vbus_request *req,
}
if
(
i
==
ARRAY_SIZE
(
_sess
))
{
rt_hw_interrupt_enable
(
l
v
l
);
rt_hw_interrupt_enable
(
l
eve
l
);
return
-
RT_ERROR
;
}
...
...
@@ -921,7 +921,7 @@ int rt_vbus_request_chn(struct rt_vbus_request *req,
if
(
req
->
is_server
)
{
_sess
[
i
].
st
=
SESSIOM_LISTENING
;
rt_hw_interrupt_enable
(
l
v
l
);
rt_hw_interrupt_enable
(
l
eve
l
);
vbus_debug
(
"request listening %s on %d
\n
"
,
req
->
name
,
i
);
...
...
@@ -933,12 +933,12 @@ int rt_vbus_request_chn(struct rt_vbus_request *req,
pbuf
=
rt_malloc
(
plen
);
if
(
!
pbuf
)
{
rt_hw_interrupt_enable
(
l
v
l
);
rt_hw_interrupt_enable
(
l
eve
l
);
return
-
RT_ENOMEM
;
}
_sess
[
i
].
st
=
SESSIOM_ESTABLISHING
;
rt_hw_interrupt_enable
(
l
v
l
);
rt_hw_interrupt_enable
(
l
eve
l
);
pbuf
[
0
]
=
RT_VBUS_CHN0_CMD_ENABLE
;
rt_memcpy
(
pbuf
+
1
,
req
->
name
,
plen
-
1
);
...
...
components/vbus/watermark_queue.h
浏览文件 @
f5b0bfd3
...
...
@@ -41,7 +41,7 @@ void rt_wm_que_dump(struct rt_watermark_queue *wg);
rt_inline
rt_err_t
rt_wm_que_inc
(
struct
rt_watermark_queue
*
wg
,
int
timeout
)
{
rt_base_t
ilv
l
;
rt_base_t
leve
l
;
/* Assert as early as possible. */
if
(
timeout
!=
0
)
...
...
@@ -49,7 +49,7 @@ rt_inline rt_err_t rt_wm_que_inc(struct rt_watermark_queue *wg,
RT_DEBUG_IN_THREAD_CONTEXT
;
}
ilv
l
=
rt_hw_interrupt_disable
();
leve
l
=
rt_hw_interrupt_disable
();
while
(
wg
->
level
>
wg
->
high_mark
)
{
...
...
@@ -57,7 +57,7 @@ rt_inline rt_err_t rt_wm_que_inc(struct rt_watermark_queue *wg,
if
(
timeout
==
0
)
{
rt_hw_interrupt_enable
(
ilv
l
);
rt_hw_interrupt_enable
(
leve
l
);
return
-
RT_EFULL
;
}
...
...
@@ -72,12 +72,12 @@ rt_inline rt_err_t rt_wm_que_inc(struct rt_watermark_queue *wg,
&
timeout
);
rt_timer_start
(
&
(
thread
->
thread_timer
));
}
rt_hw_interrupt_enable
(
ilv
l
);
rt_hw_interrupt_enable
(
leve
l
);
rt_schedule
();
if
(
thread
->
error
!=
RT_EOK
)
return
thread
->
error
;
ilv
l
=
rt_hw_interrupt_disable
();
leve
l
=
rt_hw_interrupt_disable
();
}
wg
->
level
++
;
...
...
@@ -87,7 +87,7 @@ rt_inline rt_err_t rt_wm_que_inc(struct rt_watermark_queue *wg,
wg
->
level
=
~
0
;
}
rt_hw_interrupt_enable
(
ilv
l
);
rt_hw_interrupt_enable
(
leve
l
);
return
RT_EOK
;
}
...
...
@@ -101,12 +101,12 @@ rt_inline rt_err_t rt_wm_que_inc(struct rt_watermark_queue *wg,
rt_inline
void
rt_wm_que_dec
(
struct
rt_watermark_queue
*
wg
)
{
int
need_sched
=
0
;
rt_base_t
ilv
l
;
rt_base_t
leve
l
;
if
(
wg
->
level
==
0
)
return
;
ilv
l
=
rt_hw_interrupt_disable
();
leve
l
=
rt_hw_interrupt_disable
();
wg
->
level
--
;
if
(
wg
->
level
==
wg
->
low_mark
)
{
...
...
@@ -123,7 +123,7 @@ rt_inline void rt_wm_que_dec(struct rt_watermark_queue *wg)
need_sched
=
1
;
}
}
rt_hw_interrupt_enable
(
ilv
l
);
rt_hw_interrupt_enable
(
leve
l
);
if
(
need_sched
)
rt_schedule
();
...
...
components/vmm/vmm.c
浏览文件 @
f5b0bfd3
...
...
@@ -96,7 +96,7 @@ static void vmm_entry_glue(rt_uint32_t level,
void
vmm_entry
(
struct
vmm_entry_param
*
param
)
{
rt_
uint32
_t
level
;
rt_
base
_t
level
;
level
=
rt_hw_interrupt_disable
();
...
...
libcpu/aarch64/common/cpu.c
浏览文件 @
f5b0bfd3
...
...
@@ -98,7 +98,7 @@ void rt_hw_spin_unlock(rt_hw_spinlock_t *lock)
/** shutdown CPU */
RT_WEAK
void
rt_hw_cpu_shutdown
()
{
r
t_u
int32_t
level
;
r
egister
rt_
int32_t
level
;
rt_kprintf
(
"shutdown...
\n
"
);
level
=
rt_hw_interrupt_disable
();
...
...
libcpu/aarch64/common/mmu.c
浏览文件 @
f5b0bfd3
...
...
@@ -240,7 +240,7 @@ void rt_hw_mmu_init(void)
int
rt_hw_mmu_map
(
unsigned
long
addr
,
unsigned
long
size
,
unsigned
long
attr
)
{
int
ret
;
rt_
u
base_t
level
;
rt_base_t
level
;
level
=
rt_hw_interrupt_disable
();
ret
=
rt_hw_mmu_setmtt
(
addr
,
addr
+
size
,
addr
,
attr
);
...
...
libcpu/arm/am335x/cpu.c
浏览文件 @
f5b0bfd3
...
...
@@ -151,7 +151,7 @@ rt_base_t rt_hw_cpu_dcache_status()
*/
RT_WEAK
void
rt_hw_cpu_shutdown
()
{
rt_
uint32
_t
level
;
rt_
base
_t
level
;
rt_kprintf
(
"shutdown...
\n
"
);
level
=
rt_hw_interrupt_disable
();
...
...
libcpu/arm/arm926/cpuport.c
浏览文件 @
f5b0bfd3
...
...
@@ -163,7 +163,7 @@ RT_WEAK void rt_hw_cpu_reset()
*/
RT_WEAK
void
rt_hw_cpu_shutdown
()
{
rt_
uint32
_t
level
;
rt_
base
_t
level
;
rt_kprintf
(
"shutdown...
\n
"
);
level
=
rt_hw_interrupt_disable
();
...
...
libcpu/arm/armv6/cpuport.c
浏览文件 @
f5b0bfd3
...
...
@@ -164,7 +164,7 @@ RT_WEAK void rt_hw_cpu_reset()
*/
RT_WEAK
void
rt_hw_cpu_shutdown
()
{
rt_
uint32
_t
level
;
rt_
base
_t
level
;
rt_kprintf
(
"shutdown...
\n
"
);
level
=
rt_hw_interrupt_disable
();
...
...
libcpu/arm/cortex-a/cpu.c
浏览文件 @
f5b0bfd3
...
...
@@ -65,7 +65,7 @@ void rt_hw_spin_unlock(rt_hw_spinlock_t *lock)
/** shutdown CPU */
RT_WEAK
void
rt_hw_cpu_shutdown
()
{
rt_
uint32
_t
level
;
rt_
base
_t
level
;
rt_kprintf
(
"shutdown...
\n
"
);
level
=
rt_hw_interrupt_disable
();
...
...
libcpu/arm/dm36x/cpuport.c
浏览文件 @
f5b0bfd3
...
...
@@ -162,7 +162,7 @@ RT_WEAK void rt_hw_cpu_reset()
*/
RT_WEAK
void
rt_hw_cpu_shutdown
()
{
rt_
uint32
_t
level
;
rt_
base
_t
level
;
rt_kprintf
(
"shutdown...
\n
"
);
level
=
rt_hw_interrupt_disable
();
...
...
libcpu/arm/realview-a8-vmm/cpu.c
浏览文件 @
f5b0bfd3
...
...
@@ -20,7 +20,7 @@
/** shutdown CPU */
RT_WEAK
void
rt_hw_cpu_shutdown
()
{
rt_
uint32
_t
level
;
rt_
base
_t
level
;
rt_kprintf
(
"shutdown...
\n
"
);
level
=
rt_hw_interrupt_disable
();
...
...
libcpu/arm/s3c24x0/cpu.c
浏览文件 @
f5b0bfd3
...
...
@@ -173,7 +173,7 @@ RT_WEAK void rt_hw_cpu_reset()
*/
RT_WEAK
void
rt_hw_cpu_shutdown
()
{
rt_
uint32
_t
level
;
rt_
base
_t
level
;
rt_kprintf
(
"shutdown...
\n
"
);
level
=
rt_hw_interrupt_disable
();
...
...
libcpu/arm/sep4020/cpu.c
浏览文件 @
f5b0bfd3
...
...
@@ -11,7 +11,7 @@
#include <rtthread.h>
#include <sep4020.h>
extern
rt_
uint32
_t
rt_hw_interrupt_disable
(
void
);
extern
rt_
base
_t
rt_hw_interrupt_disable
(
void
);
//TODO
#warning I DON'T KNOW IF THE MMU OPERATION WORKS ON SEP4020
...
...
@@ -175,12 +175,14 @@ RT_WEAK void rt_hw_cpu_reset()
*/
RT_WEAK
void
rt_hw_cpu_shutdown
()
{
rt_
uint32_t
UNUSED
level
;
rt_
base_t
level
;
rt_kprintf
(
"shutdown...
\n
"
);
level
=
rt_hw_interrupt_disable
();
RT_ASSERT
(
RT_NULL
);
while
(
level
)
{
RT_ASSERT
(
RT_NULL
);
}
}
/*@}*/
libcpu/arm/zynqmp-r5/cpu.c
浏览文件 @
f5b0bfd3
...
...
@@ -25,7 +25,7 @@ void rt_hw_cpu_reset()
*/
void
rt_hw_cpu_shutdown
()
{
rt_
uint32
_t
level
;
rt_
base
_t
level
;
rt_kprintf
(
"shutdown...
\n
"
);
level
=
rt_hw_interrupt_disable
();
...
...
libcpu/mips/common/exception.c
浏览文件 @
f5b0bfd3
...
...
@@ -61,7 +61,7 @@ const char *exception_name[] = {
rt_base_t
rt_hw_interrupt_disable
(
void
)
{
rt_base_t
status
=
read_c0_status
();
r
egister
r
t_base_t
status
=
read_c0_status
();
clear_c0_status
(
ST0_IE
);
return
status
;
}
...
...
libcpu/mips/gs264/mmu.c
浏览文件 @
f5b0bfd3
...
...
@@ -803,7 +803,8 @@ void *rt_hw_mmu_v2p(rt_mmu_info *mmu_info, void* v_addr)
}
#ifdef RT_USING_USERSPACE
void
init_mm_setup
(
unsigned
int
*
mtbl
,
unsigned
int
size
,
unsigned
int
pv_off
)
{
void
init_mm_setup
(
unsigned
int
*
mtbl
,
unsigned
int
size
,
unsigned
int
pv_off
)
{
unsigned
int
va
;
for
(
va
=
0
;
va
<
0x1000
;
va
++
)
{
...
...
libcpu/ppc/ppc405/interrupt.c
浏览文件 @
f5b0bfd3
...
...
@@ -77,7 +77,7 @@ void uic_interrupt(rt_uint32_t uic_base, int vec_base)
rt_isr_handler_t
rt_hw_interrupt_install
(
int
vector
,
rt_isr_handler_t
new_handler
,
void
*
param
,
const
char
*
name
)
{
int
intVa
l
;
rt_base_t
leve
l
;
rt_isr_handler_t
old_handler
;
if
(((
int
)
vector
<
0
)
||
((
int
)
vector
>=
MAX_HANDLERS
))
...
...
@@ -86,13 +86,13 @@ rt_isr_handler_t rt_hw_interrupt_install(int vector, rt_isr_handler_t new_handle
}
/* install the handler in the system interrupt table */
intVal
=
rt_hw_interrupt_disable
();
/* lock interrupts to prevent races */
level
=
rt_hw_interrupt_disable
();
/* lock interrupts to prevent races */
old_handler
=
isr_table
[
vector
].
handler
;
isr_table
[
vector
].
handler
=
new_handler
;
isr_table
[
vector
].
param
=
param
;
rt_hw_interrupt_enable
(
intVa
l
);
rt_hw_interrupt_enable
(
leve
l
);
}
void
rt_hw_interrupt_mask
(
int
vector
)
...
...
libcpu/risc-v/ch32v1/cpuport.c
浏览文件 @
f5b0bfd3
...
...
@@ -151,7 +151,7 @@ void sw_clearpend(void)
*/
rt_base_t
rt_hw_interrupt_disable
(
void
)
{
rt_base_t
value
=
0
;
r
egister
r
t_base_t
value
=
0
;
asm
(
"csrrw %0, mstatus, %1"
:
"=r"
(
value
)
:
"r"
(
0x1800
));
return
value
;
}
...
...
@@ -188,7 +188,7 @@ void rt_hw_context_switch_interrupt(rt_ubase_t from, rt_ubase_t to)
/* shutdown CPU */
void
rt_hw_cpu_shutdown
(
void
)
{
rt_
uint32
_t
level
;
rt_
base
_t
level
;
rt_kprintf
(
"shutdown...
\n
"
);
level
=
rt_hw_interrupt_disable
();
...
...
libcpu/risc-v/common/cpuport.c
浏览文件 @
f5b0bfd3
...
...
@@ -153,7 +153,7 @@ void rt_hw_context_switch_interrupt(rt_ubase_t from, rt_ubase_t to)
/** shutdown CPU */
RT_WEAK
void
rt_hw_cpu_shutdown
()
{
rt_
uint32
_t
level
;
rt_
base
_t
level
;
rt_kprintf
(
"shutdown...
\n
"
);
level
=
rt_hw_interrupt_disable
();
...
...
libcpu/risc-v/nuclei/cpuport.c
浏览文件 @
f5b0bfd3
...
...
@@ -152,7 +152,7 @@ void rt_hw_context_switch(rt_ubase_t from, rt_ubase_t to)
*/
RT_WEAK
void
rt_hw_cpu_shutdown
()
{
rt_
uint32
_t
level
;
rt_
base
_t
level
;
rt_kprintf
(
"shutdown...
\n
"
);
level
=
rt_hw_interrupt_disable
();
...
...
libcpu/risc-v/t-head/e9xx/cpuport.c
浏览文件 @
f5b0bfd3
...
...
@@ -137,7 +137,7 @@ rt_uint8_t *rt_hw_stack_init(void *tentry,
/** shutdown CPU */
RT_WEAK
void
rt_hw_cpu_shutdown
()
{
rt_
uint32
_t
level
;
rt_
base
_t
level
;
rt_kprintf
(
"shutdown...
\n
"
);
level
=
rt_hw_interrupt_disable
();
...
...
libcpu/risc-v/virt64/cpuport.c
浏览文件 @
f5b0bfd3
...
...
@@ -102,7 +102,7 @@ void rt_hw_context_switch_interrupt(rt_ubase_t from, rt_ubase_t to)
/** shutdown CPU */
void
rt_hw_cpu_shutdown
()
{
rt_
uint32
_t
level
;
rt_
base
_t
level
;
rt_kprintf
(
"shutdown...
\n
"
);
level
=
rt_hw_interrupt_disable
();
...
...
libcpu/unicore32/sep6200/cpu.c
浏览文件 @
f5b0bfd3
...
...
@@ -262,7 +262,7 @@ RT_WEAK void rt_hw_cpu_reset()
*/
RT_WEAK
void
rt_hw_cpu_shutdown
()
{
rt_
uint32
_t
level
;
rt_
base
_t
level
;
rt_kprintf
(
"shutdown...
\n
"
);
level
=
rt_hw_interrupt_disable
();
...
...
src/cpu.c
浏览文件 @
f5b0bfd3
...
...
@@ -19,7 +19,7 @@ rt_hw_spinlock_t _cpus_lock;
*/
static
void
_cpu_preempt_disable
(
void
)
{
r
egister
r
t_base_t
level
;
rt_base_t
level
;
struct
rt_thread
*
current_thread
;
/* disable interrupt */
...
...
@@ -44,7 +44,7 @@ static void _cpu_preempt_disable(void)
*/
static
void
_cpu_preempt_enable
(
void
)
{
r
egister
r
t_base_t
level
;
rt_base_t
level
;
struct
rt_thread
*
current_thread
;
/* disable interrupt */
...
...
src/idle.c
浏览文件 @
f5b0bfd3
...
...
@@ -155,13 +155,13 @@ void rt_thread_defunct_enqueue(rt_thread_t thread)
*/
rt_thread_t
rt_thread_defunct_dequeue
(
void
)
{
r
egister
rt_base_t
lock
;
r
t_base_t
level
;
rt_thread_t
thread
=
RT_NULL
;
rt_list_t
*
l
=
&
_rt_thread_defunct
;
#ifdef RT_USING_SMP
/* disable interrupt */
l
ock
=
rt_hw_interrupt_disable
();
l
evel
=
rt_hw_interrupt_disable
();
if
(
l
->
next
!=
l
)
{
thread
=
rt_list_entry
(
l
->
next
,
...
...
@@ -169,16 +169,16 @@ rt_thread_t rt_thread_defunct_dequeue(void)
tlist
);
rt_list_remove
(
&
(
thread
->
tlist
));
}
rt_hw_interrupt_enable
(
l
ock
);
rt_hw_interrupt_enable
(
l
evel
);
#else
if
(
l
->
next
!=
l
)
{
thread
=
rt_list_entry
(
l
->
next
,
struct
rt_thread
,
tlist
);
l
ock
=
rt_hw_interrupt_disable
();
l
evel
=
rt_hw_interrupt_disable
();
rt_list_remove
(
&
(
thread
->
tlist
));
rt_hw_interrupt_enable
(
l
ock
);
rt_hw_interrupt_enable
(
l
evel
);
}
#endif
return
thread
;
...
...
src/ipc.c
浏览文件 @
f5b0bfd3
此差异已折叠。
点击以展开。
src/mem.c
浏览文件 @
f5b0bfd3
...
...
@@ -563,7 +563,7 @@ RTM_EXPORT(rt_smem_free);
int
memcheck
(
int
argc
,
char
*
argv
[])
{
int
position
;
rt_
u
base_t
level
;
rt_base_t
level
;
struct
rt_small_mem_item
*
mem
;
struct
rt_small_mem
*
m
;
struct
rt_object_information
*
information
;
...
...
src/mempool.c
浏览文件 @
f5b0bfd3
...
...
@@ -146,7 +146,7 @@ RTM_EXPORT(rt_mp_init);
rt_err_t
rt_mp_detach
(
struct
rt_mempool
*
mp
)
{
struct
rt_thread
*
thread
;
r
egister
rt_u
base_t
level
;
r
t_
base_t
level
;
/* parameter check */
RT_ASSERT
(
mp
!=
RT_NULL
);
...
...
@@ -264,7 +264,7 @@ RTM_EXPORT(rt_mp_create);
rt_err_t
rt_mp_delete
(
rt_mp_t
mp
)
{
struct
rt_thread
*
thread
;
r
egister
rt_u
base_t
level
;
r
t_
base_t
level
;
RT_DEBUG_NOT_IN_INTERRUPT
;
...
...
@@ -319,7 +319,7 @@ RTM_EXPORT(rt_mp_delete);
void
*
rt_mp_alloc
(
rt_mp_t
mp
,
rt_int32_t
time
)
{
rt_uint8_t
*
block_ptr
;
r
egister
r
t_base_t
level
;
rt_base_t
level
;
struct
rt_thread
*
thread
;
rt_uint32_t
before_sleep
=
0
;
...
...
@@ -417,7 +417,7 @@ void rt_mp_free(void *block)
rt_uint8_t
**
block_ptr
;
struct
rt_mempool
*
mp
;
struct
rt_thread
*
thread
;
r
egister
r
t_base_t
level
;
rt_base_t
level
;
/* parameter check */
if
(
block
==
RT_NULL
)
return
;
...
...
src/object.c
浏览文件 @
f5b0bfd3
...
...
@@ -253,7 +253,7 @@ RTM_EXPORT(rt_object_get_information);
int
rt_object_get_length
(
enum
rt_object_class_type
type
)
{
int
count
=
0
;
rt_
u
base_t
level
;
rt_base_t
level
;
struct
rt_list_node
*
node
=
RT_NULL
;
struct
rt_object_information
*
information
=
RT_NULL
;
...
...
@@ -288,7 +288,7 @@ RTM_EXPORT(rt_object_get_length);
int
rt_object_get_pointers
(
enum
rt_object_class_type
type
,
rt_object_t
*
pointers
,
int
maxlen
)
{
int
index
=
0
;
rt_
u
base_t
level
;
rt_base_t
level
;
struct
rt_object
*
object
;
struct
rt_list_node
*
node
=
RT_NULL
;
...
...
@@ -330,7 +330,7 @@ void rt_object_init(struct rt_object *object,
enum
rt_object_class_type
type
,
const
char
*
name
)
{
r
egister
rt_base_t
temp
;
r
t_base_t
level
;
struct
rt_list_node
*
node
=
RT_NULL
;
struct
rt_object_information
*
information
;
#ifdef RT_USING_MODULE
...
...
@@ -370,7 +370,7 @@ void rt_object_init(struct rt_object *object,
RT_OBJECT_HOOK_CALL
(
rt_object_attach_hook
,
(
object
));
/* lock interrupt */
temp
=
rt_hw_interrupt_disable
();
level
=
rt_hw_interrupt_disable
();
#ifdef RT_USING_MODULE
if
(
module
)
...
...
@@ -386,7 +386,7 @@ void rt_object_init(struct rt_object *object,
}
/* unlock interrupt */
rt_hw_interrupt_enable
(
temp
);
rt_hw_interrupt_enable
(
level
);
}
/**
...
...
@@ -397,7 +397,7 @@ void rt_object_init(struct rt_object *object,
*/
void
rt_object_detach
(
rt_object_t
object
)
{
r
egister
rt_base_t
temp
;
r
t_base_t
level
;
/* object check */
RT_ASSERT
(
object
!=
RT_NULL
);
...
...
@@ -408,13 +408,13 @@ void rt_object_detach(rt_object_t object)
object
->
type
=
0
;
/* lock interrupt */
temp
=
rt_hw_interrupt_disable
();
level
=
rt_hw_interrupt_disable
();
/* remove from old list */
rt_list_remove
(
&
(
object
->
list
));
/* unlock interrupt */
rt_hw_interrupt_enable
(
temp
);
rt_hw_interrupt_enable
(
level
);
}
#ifdef RT_USING_HEAP
...
...
@@ -430,7 +430,7 @@ void rt_object_detach(rt_object_t object)
rt_object_t
rt_object_allocate
(
enum
rt_object_class_type
type
,
const
char
*
name
)
{
struct
rt_object
*
object
;
r
egister
rt_base_t
temp
;
r
t_base_t
level
;
struct
rt_object_information
*
information
;
#ifdef RT_USING_MODULE
struct
rt_dlmodule
*
module
=
dlmodule_self
();
...
...
@@ -466,7 +466,7 @@ rt_object_t rt_object_allocate(enum rt_object_class_type type, const char *name)
RT_OBJECT_HOOK_CALL
(
rt_object_attach_hook
,
(
object
));
/* lock interrupt */
temp
=
rt_hw_interrupt_disable
();
level
=
rt_hw_interrupt_disable
();
#ifdef RT_USING_MODULE
if
(
module
)
...
...
@@ -482,7 +482,7 @@ rt_object_t rt_object_allocate(enum rt_object_class_type type, const char *name)
}
/* unlock interrupt */
rt_hw_interrupt_enable
(
temp
);
rt_hw_interrupt_enable
(
level
);
/* return object */
return
object
;
...
...
@@ -495,7 +495,7 @@ rt_object_t rt_object_allocate(enum rt_object_class_type type, const char *name)
*/
void
rt_object_delete
(
rt_object_t
object
)
{
r
egister
rt_base_t
temp
;
r
t_base_t
level
;
/* object check */
RT_ASSERT
(
object
!=
RT_NULL
);
...
...
@@ -507,13 +507,13 @@ void rt_object_delete(rt_object_t object)
object
->
type
=
RT_Object_Class_Null
;
/* lock interrupt */
temp
=
rt_hw_interrupt_disable
();
level
=
rt_hw_interrupt_disable
();
/* remove from old list */
rt_list_remove
(
&
(
object
->
list
));
/* unlock interrupt */
rt_hw_interrupt_enable
(
temp
);
rt_hw_interrupt_enable
(
level
);
/* free the memory of object */
RT_KERNEL_FREE
(
object
);
...
...
src/scheduler.c
浏览文件 @
f5b0bfd3
...
...
@@ -103,7 +103,7 @@ static void _rt_scheduler_stack_check(struct rt_thread *thread)
(
rt_ubase_t
)
thread
->
sp
>
(
rt_ubase_t
)
thread
->
stack_addr
+
(
rt_ubase_t
)
thread
->
stack_size
)
{
rt_
u
base_t
level
;
rt_base_t
level
;
rt_kprintf
(
"thread:%s stack overflow
\n
"
,
thread
->
name
);
...
...
@@ -655,7 +655,7 @@ void rt_schedule_insert_thread(struct rt_thread *thread)
int
cpu_id
;
int
bind_cpu
;
rt_uint32_t
cpu_mask
;
r
egister
r
t_base_t
level
;
rt_base_t
level
;
RT_ASSERT
(
thread
!=
RT_NULL
);
...
...
@@ -717,12 +717,12 @@ __exit:
#else
void
rt_schedule_insert_thread
(
struct
rt_thread
*
thread
)
{
r
egister
rt_base_t
temp
;
r
t_base_t
level
;
RT_ASSERT
(
thread
!=
RT_NULL
);
/* disable interrupt */
temp
=
rt_hw_interrupt_disable
();
level
=
rt_hw_interrupt_disable
();
/* it's current thread, it should be RUNNING thread */
if
(
thread
==
rt_current_thread
)
...
...
@@ -748,7 +748,7 @@ void rt_schedule_insert_thread(struct rt_thread *thread)
__exit:
/* enable interrupt */
rt_hw_interrupt_enable
(
temp
);
rt_hw_interrupt_enable
(
level
);
}
#endif
/* RT_USING_SMP */
...
...
@@ -762,7 +762,7 @@ __exit:
#ifdef RT_USING_SMP
void
rt_schedule_remove_thread
(
struct
rt_thread
*
thread
)
{
r
egister
r
t_base_t
level
;
rt_base_t
level
;
RT_ASSERT
(
thread
!=
RT_NULL
);
...
...
@@ -814,7 +814,7 @@ void rt_schedule_remove_thread(struct rt_thread *thread)
#else
void
rt_schedule_remove_thread
(
struct
rt_thread
*
thread
)
{
r
egister
r
t_base_t
level
;
rt_base_t
level
;
RT_ASSERT
(
thread
!=
RT_NULL
);
...
...
@@ -851,7 +851,7 @@ void rt_schedule_remove_thread(struct rt_thread *thread)
#ifdef RT_USING_SMP
void
rt_enter_critical
(
void
)
{
r
egister
r
t_base_t
level
;
rt_base_t
level
;
struct
rt_thread
*
current_thread
;
/* disable interrupt */
...
...
@@ -890,7 +890,7 @@ void rt_enter_critical(void)
#else
void
rt_enter_critical
(
void
)
{
r
egister
r
t_base_t
level
;
rt_base_t
level
;
/* disable interrupt */
level
=
rt_hw_interrupt_disable
();
...
...
@@ -913,7 +913,7 @@ RTM_EXPORT(rt_enter_critical);
#ifdef RT_USING_SMP
void
rt_exit_critical
(
void
)
{
r
egister
r
t_base_t
level
;
rt_base_t
level
;
struct
rt_thread
*
current_thread
;
/* disable interrupt */
...
...
@@ -954,7 +954,7 @@ void rt_exit_critical(void)
#else
void
rt_exit_critical
(
void
)
{
r
egister
r
t_base_t
level
;
rt_base_t
level
;
/* disable interrupt */
level
=
rt_hw_interrupt_disable
();
...
...
src/signal.c
浏览文件 @
f5b0bfd3
...
...
@@ -91,7 +91,7 @@ static void _signal_entry(void *parameter)
*/
static
void
_signal_deliver
(
rt_thread_t
tid
)
{
rt_
u
base_t
level
;
rt_base_t
level
;
level
=
rt_hw_interrupt_disable
();
...
...
@@ -321,7 +321,7 @@ void rt_signal_unmask(int signo)
int
rt_signal_wait
(
const
rt_sigset_t
*
set
,
rt_siginfo_t
*
si
,
rt_int32_t
timeout
)
{
int
ret
=
RT_EOK
;
rt_base_t
level
;
rt_base_t
level
;
rt_thread_t
tid
=
rt_thread_self
();
struct
siginfo_node
*
si_node
=
RT_NULL
,
*
si_prev
=
RT_NULL
;
...
...
src/thread.c
浏览文件 @
f5b0bfd3
...
...
@@ -91,7 +91,7 @@ void rt_thread_inited_sethook(void (*hook)(rt_thread_t thread))
static
void
_thread_exit
(
void
)
{
struct
rt_thread
*
thread
;
r
egister
r
t_base_t
level
;
rt_base_t
level
;
/* get current thread */
thread
=
rt_thread_self
();
...
...
@@ -127,7 +127,7 @@ static void _thread_exit(void)
static
void
_thread_timeout
(
void
*
parameter
)
{
struct
rt_thread
*
thread
;
r
egister
rt_base_t
temp
;
r
t_base_t
level
;
thread
=
(
struct
rt_thread
*
)
parameter
;
...
...
@@ -137,7 +137,7 @@ static void _thread_timeout(void *parameter)
RT_ASSERT
(
rt_object_get_type
((
rt_object_t
)
thread
)
==
RT_Object_Class_Thread
);
/* disable interrupt */
temp
=
rt_hw_interrupt_disable
();
level
=
rt_hw_interrupt_disable
();
/* set error number */
thread
->
error
=
-
RT_ETIMEOUT
;
...
...
@@ -149,7 +149,7 @@ static void _thread_timeout(void *parameter)
rt_schedule_insert_thread
(
thread
);
/* enable interrupt */
rt_hw_interrupt_enable
(
temp
);
rt_hw_interrupt_enable
(
level
);
/* do schedule */
rt_schedule
();
...
...
@@ -327,7 +327,7 @@ RTM_EXPORT(rt_thread_init);
rt_thread_t
rt_thread_self
(
void
)
{
#ifdef RT_USING_SMP
rt_base_t
lock
;
r
egister
r
t_base_t
lock
;
rt_thread_t
self
;
lock
=
rt_hw_local_irq_disable
();
...
...
@@ -393,7 +393,7 @@ RTM_EXPORT(rt_thread_startup);
*/
rt_err_t
rt_thread_detach
(
rt_thread_t
thread
)
{
rt_base_t
l
ock
;
rt_base_t
l
evel
;
/* parameter check */
RT_ASSERT
(
thread
!=
RT_NULL
);
...
...
@@ -410,7 +410,7 @@ rt_err_t rt_thread_detach(rt_thread_t thread)
}
/* disable interrupt */
l
ock
=
rt_hw_interrupt_disable
();
l
evel
=
rt_hw_interrupt_disable
();
/* release thread timer */
rt_timer_detach
(
&
(
thread
->
thread_timer
));
...
...
@@ -422,7 +422,7 @@ rt_err_t rt_thread_detach(rt_thread_t thread)
rt_thread_defunct_enqueue
(
thread
);
/* enable interrupt */
rt_hw_interrupt_enable
(
l
ock
);
rt_hw_interrupt_enable
(
l
evel
);
return
RT_EOK
;
}
...
...
@@ -496,7 +496,7 @@ RTM_EXPORT(rt_thread_create);
*/
rt_err_t
rt_thread_delete
(
rt_thread_t
thread
)
{
rt_base_t
l
ock
;
rt_base_t
l
evel
;
/* parameter check */
RT_ASSERT
(
thread
!=
RT_NULL
);
...
...
@@ -513,7 +513,7 @@ rt_err_t rt_thread_delete(rt_thread_t thread)
}
/* disable interrupt */
l
ock
=
rt_hw_interrupt_disable
();
l
evel
=
rt_hw_interrupt_disable
();
/* release thread timer */
rt_timer_detach
(
&
(
thread
->
thread_timer
));
...
...
@@ -525,7 +525,7 @@ rt_err_t rt_thread_delete(rt_thread_t thread)
rt_thread_defunct_enqueue
(
thread
);
/* enable interrupt */
rt_hw_interrupt_enable
(
l
ock
);
rt_hw_interrupt_enable
(
l
evel
);
return
RT_EOK
;
}
...
...
@@ -543,14 +543,14 @@ RTM_EXPORT(rt_thread_delete);
rt_err_t
rt_thread_yield
(
void
)
{
struct
rt_thread
*
thread
;
rt_base_t
l
ock
;
rt_base_t
l
evel
;
thread
=
rt_thread_self
();
l
ock
=
rt_hw_interrupt_disable
();
l
evel
=
rt_hw_interrupt_disable
();
thread
->
remaining_tick
=
thread
->
init_tick
;
thread
->
stat
|=
RT_THREAD_STAT_YIELD
;
rt_schedule
();
rt_hw_interrupt_enable
(
l
ock
);
rt_hw_interrupt_enable
(
l
evel
);
return
RT_EOK
;
}
...
...
@@ -567,7 +567,7 @@ RTM_EXPORT(rt_thread_yield);
*/
rt_err_t
rt_thread_sleep
(
rt_tick_t
tick
)
{
r
egister
rt_base_t
temp
;
r
t_base_t
level
;
struct
rt_thread
*
thread
;
/* set to current thread */
...
...
@@ -576,7 +576,7 @@ rt_err_t rt_thread_sleep(rt_tick_t tick)
RT_ASSERT
(
rt_object_get_type
((
rt_object_t
)
thread
)
==
RT_Object_Class_Thread
);
/* disable interrupt */
temp
=
rt_hw_interrupt_disable
();
level
=
rt_hw_interrupt_disable
();
/* reset thread error */
thread
->
error
=
RT_EOK
;
...
...
@@ -589,7 +589,7 @@ rt_err_t rt_thread_sleep(rt_tick_t tick)
rt_timer_start
(
&
(
thread
->
thread_timer
));
/* enable interrupt */
rt_hw_interrupt_enable
(
temp
);
rt_hw_interrupt_enable
(
level
);
rt_schedule
();
...
...
@@ -626,7 +626,7 @@ RTM_EXPORT(rt_thread_delay);
*/
rt_err_t
rt_thread_delay_until
(
rt_tick_t
*
tick
,
rt_tick_t
inc_tick
)
{
r
egister
r
t_base_t
level
;
rt_base_t
level
;
struct
rt_thread
*
thread
;
rt_tick_t
cur_tick
;
...
...
@@ -719,7 +719,7 @@ RTM_EXPORT(rt_thread_mdelay);
*/
rt_err_t
rt_thread_control
(
rt_thread_t
thread
,
int
cmd
,
void
*
arg
)
{
r
egister
rt_base_t
temp
;
r
t_base_t
level
;
/* parameter check */
RT_ASSERT
(
thread
!=
RT_NULL
);
...
...
@@ -730,7 +730,7 @@ rt_err_t rt_thread_control(rt_thread_t thread, int cmd, void *arg)
case
RT_THREAD_CTRL_CHANGE_PRIORITY
:
{
/* disable interrupt */
temp
=
rt_hw_interrupt_disable
();
level
=
rt_hw_interrupt_disable
();
/* for ready thread, change queue */
if
((
thread
->
stat
&
RT_THREAD_STAT_MASK
)
==
RT_THREAD_READY
)
...
...
@@ -768,7 +768,7 @@ rt_err_t rt_thread_control(rt_thread_t thread, int cmd, void *arg)
}
/* enable interrupt */
rt_hw_interrupt_enable
(
temp
);
rt_hw_interrupt_enable
(
level
);
break
;
}
...
...
@@ -837,7 +837,7 @@ RTM_EXPORT(rt_thread_control);
rt_err_t
rt_thread_suspend
(
rt_thread_t
thread
)
{
register
rt_base_t
stat
;
r
egister
rt_base_t
temp
;
r
t_base_t
level
;
/* parameter check */
RT_ASSERT
(
thread
!=
RT_NULL
);
...
...
@@ -854,7 +854,7 @@ rt_err_t rt_thread_suspend(rt_thread_t thread)
}
/* disable interrupt */
temp
=
rt_hw_interrupt_disable
();
level
=
rt_hw_interrupt_disable
();
/* change thread stat */
rt_schedule_remove_thread
(
thread
);
...
...
@@ -864,7 +864,7 @@ rt_err_t rt_thread_suspend(rt_thread_t thread)
rt_timer_stop
(
&
(
thread
->
thread_timer
));
/* enable interrupt */
rt_hw_interrupt_enable
(
temp
);
rt_hw_interrupt_enable
(
level
);
RT_OBJECT_HOOK_CALL
(
rt_thread_suspend_hook
,
(
thread
));
return
RT_EOK
;
...
...
@@ -883,7 +883,7 @@ RTM_EXPORT(rt_thread_suspend);
*/
rt_err_t
rt_thread_resume
(
rt_thread_t
thread
)
{
r
egister
rt_base_t
temp
;
r
t_base_t
level
;
/* parameter check */
RT_ASSERT
(
thread
!=
RT_NULL
);
...
...
@@ -900,7 +900,7 @@ rt_err_t rt_thread_resume(rt_thread_t thread)
}
/* disable interrupt */
temp
=
rt_hw_interrupt_disable
();
level
=
rt_hw_interrupt_disable
();
/* remove from suspend list */
rt_list_remove
(
&
(
thread
->
tlist
));
...
...
@@ -911,7 +911,7 @@ rt_err_t rt_thread_resume(rt_thread_t thread)
rt_schedule_insert_thread
(
thread
);
/* enable interrupt */
rt_hw_interrupt_enable
(
temp
);
rt_hw_interrupt_enable
(
level
);
RT_OBJECT_HOOK_CALL
(
rt_thread_resume_hook
,
(
thread
));
return
RT_EOK
;
...
...
src/timer.c
浏览文件 @
f5b0bfd3
...
...
@@ -156,7 +156,7 @@ static void _timer_init(rt_timer_t timer,
static
rt_err_t
_timer_list_next_timeout
(
rt_list_t
timer_list
[],
rt_tick_t
*
timeout_tick
)
{
struct
rt_timer
*
timer
;
r
egister
r
t_base_t
level
;
rt_base_t
level
;
/* disable interrupt */
level
=
rt_hw_interrupt_disable
();
...
...
@@ -288,7 +288,7 @@ RTM_EXPORT(rt_timer_init);
*/
rt_err_t
rt_timer_detach
(
rt_timer_t
timer
)
{
r
egister
r
t_base_t
level
;
rt_base_t
level
;
/* parameter check */
RT_ASSERT
(
timer
!=
RT_NULL
);
...
...
@@ -363,7 +363,7 @@ RTM_EXPORT(rt_timer_create);
*/
rt_err_t
rt_timer_delete
(
rt_timer_t
timer
)
{
r
egister
r
t_base_t
level
;
rt_base_t
level
;
/* parameter check */
RT_ASSERT
(
timer
!=
RT_NULL
);
...
...
@@ -398,7 +398,7 @@ rt_err_t rt_timer_start(rt_timer_t timer)
{
unsigned
int
row_lvl
;
rt_list_t
*
timer_list
;
r
egister
r
t_base_t
level
;
rt_base_t
level
;
register
rt_bool_t
need_schedule
;
rt_list_t
*
row_head
[
RT_TIMER_SKIP_LIST_LEVEL
];
unsigned
int
tst_nr
;
...
...
@@ -522,7 +522,7 @@ RTM_EXPORT(rt_timer_start);
*/
rt_err_t
rt_timer_stop
(
rt_timer_t
timer
)
{
r
egister
r
t_base_t
level
;
rt_base_t
level
;
/* parameter check */
RT_ASSERT
(
timer
!=
RT_NULL
);
...
...
@@ -558,7 +558,7 @@ RTM_EXPORT(rt_timer_stop);
*/
rt_err_t
rt_timer_control
(
rt_timer_t
timer
,
int
cmd
,
void
*
arg
)
{
r
egister
r
t_base_t
level
;
rt_base_t
level
;
/* parameter check */
RT_ASSERT
(
timer
!=
RT_NULL
);
...
...
@@ -618,7 +618,7 @@ void rt_timer_check(void)
{
struct
rt_timer
*
t
;
rt_tick_t
current_tick
;
r
egister
r
t_base_t
level
;
rt_base_t
level
;
rt_list_t
list
;
rt_list_init
(
&
list
);
...
...
@@ -704,7 +704,7 @@ void rt_soft_timer_check(void)
{
rt_tick_t
current_tick
;
struct
rt_timer
*
t
;
r
egister
r
t_base_t
level
;
rt_base_t
level
;
rt_list_t
list
;
rt_list_init
(
&
list
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录