修复objspace数组访问越界的bug
This commit is contained in:
@@ -61,6 +61,7 @@ static inline syscall_prot_t syscall_prot_create(uint8_t op, uint8_t prot, obj_h
|
||||
.op = op,
|
||||
.prot = prot,
|
||||
.obj_inx = obj_inx,
|
||||
.self = 0,
|
||||
};
|
||||
}
|
||||
static inline syscall_prot_t syscall_prot_create4(uint8_t op, uint8_t prot, obj_handler_t obj_inx, uint8_t self)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include <pthread.h>
|
||||
|
||||
#define HANDLER_START_INX 10 //!< fd开始的值,前10个内核保留
|
||||
#define HANDLER_MAX_NR 64 //!< 单个task最大支持的hd数量
|
||||
#define HANDLER_MAX_NR 64 //!< 单个task最大支持的hd数量
|
||||
|
||||
static umword_t bitmap_handler_alloc[HANDLER_MAX_NR / WORD_BYTES];
|
||||
static pthread_spinlock_t lock;
|
||||
|
||||
@@ -34,8 +34,9 @@ int main(int argc, char *args[])
|
||||
app_test();
|
||||
mpu_test();
|
||||
ipc_test();
|
||||
thread_press_test();
|
||||
#endif
|
||||
// thread_press_test();
|
||||
kobj_create_press_test();
|
||||
uenv_t env = *u_get_global_env();
|
||||
obj_handler_t ipc_hd;
|
||||
int ret = rpc_creaite_bind_ipc(THREAD_MAIN, NULL, &ipc_hd);
|
||||
|
||||
20
mkrtos_user/server/init/src/test/kobj_create_press.c
Normal file
20
mkrtos_user/server/init/src/test/kobj_create_press.c
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
#include "u_log.h"
|
||||
#include "u_prot.h"
|
||||
#include "u_mm.h"
|
||||
#include "u_factory.h"
|
||||
#include "u_thread.h"
|
||||
#include "u_task.h"
|
||||
#include "u_ipc.h"
|
||||
#include "u_hd_man.h"
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include "test.h"
|
||||
void kobj_create_press_test(void)
|
||||
{
|
||||
while (1)
|
||||
{
|
||||
msg_tag_t tag = factory_create_ipc(FACTORY_PROT, vpage_create_raw3(KOBJ_ALL_RIGHTS, 0, handler_alloc()));
|
||||
assert(msg_tag_get_prot(tag) >= 0);
|
||||
}
|
||||
}
|
||||
@@ -14,4 +14,5 @@ void map_test(void);
|
||||
void ipc_timeout_test(void);
|
||||
void irq_test(void);
|
||||
void thread_press_test(void);
|
||||
void kobj_create_press_test(void);
|
||||
void sleep_tick(int tick);
|
||||
|
||||
Reference in New Issue
Block a user