fix: correct typos and improve comments across multiple files by codespell (#4116)
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
This commit is contained in:
@ -1715,7 +1715,7 @@ load_types(const uint8 **p_buf, const uint8 *buf_end, AOTModule *module,
|
||||
read_uint16(buf, buf_end, type_flag);
|
||||
|
||||
read_uint8(buf, buf_end, is_equivalence_type);
|
||||
/* If there is an equivalence type, re-use it */
|
||||
/* If there is an equivalence type, reuse it */
|
||||
if (is_equivalence_type) {
|
||||
uint8 u8;
|
||||
/* padding */
|
||||
|
||||
@ -154,7 +154,7 @@ check_reloc_offset(uint32 target_section_size, uint64 reloc_offset,
|
||||
* CPU like esp32 can read and write data through the instruction bus, but only
|
||||
* in a word aligned manner; non-word-aligned access will cause a CPU exception.
|
||||
* This function uses a world aligned manner to write 16bit value to instruction
|
||||
* addreess.
|
||||
* address.
|
||||
*/
|
||||
static void
|
||||
put_imm16_to_addr(int16 imm16, int16 *addr)
|
||||
|
||||
@ -45,7 +45,7 @@ _invokeNative:
|
||||
|
||||
/* Now x20 points to stack args */
|
||||
|
||||
/* Directly call the fucntion if no args in stack */
|
||||
/* Directly call the function if no args in stack */
|
||||
cmp x21, #0
|
||||
beq call_func
|
||||
|
||||
@ -69,7 +69,7 @@ loop_stack_args: /* copy stack arguments to stack */
|
||||
call_func:
|
||||
mov x20, x30 /* save x30(lr) */
|
||||
blr x19
|
||||
mov sp, x22 /* restore sp which is saved before calling fuction*/
|
||||
mov sp, x22 /* restore sp which is saved before calling function*/
|
||||
|
||||
return:
|
||||
mov x30, x20 /* restore x30(lr) */
|
||||
|
||||
@ -43,7 +43,7 @@ _invokeNative:
|
||||
|
||||
/* Now x20 points to stack args */
|
||||
|
||||
/* Directly call the fucntion if no args in stack */
|
||||
/* Directly call the function if no args in stack */
|
||||
cmp x21, #0
|
||||
beq call_func
|
||||
|
||||
@ -67,7 +67,7 @@ loop_stack_args: /* copy stack arguments to stack */
|
||||
call_func:
|
||||
mov x20, x30 /* save x30(lr) */
|
||||
blr x19
|
||||
mov sp, x22 /* restore sp which is saved before calling fuction*/
|
||||
mov sp, x22 /* restore sp which is saved before calling function*/
|
||||
|
||||
return:
|
||||
mov x30, x20 /* restore x30(lr) */
|
||||
|
||||
@ -53,7 +53,7 @@ _invokeNative:
|
||||
vldr s13, [r4, #52]
|
||||
vldr s14, [r4, #56]
|
||||
vldr s15, [r4, #60]
|
||||
/* Directly call the fucntion if no args in stack */
|
||||
/* Directly call the function if no args in stack */
|
||||
cmp r5, #0
|
||||
beq call_func
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* The float abi macros used bellow are from risc-v c api:
|
||||
* The float abi macros used below are from risc-v c api:
|
||||
* https://github.com/riscv/riscv-c-api-doc/blob/master/riscv-c-api.md
|
||||
*
|
||||
*/
|
||||
@ -130,7 +130,7 @@ _invokeNative:
|
||||
loop_stack_args:
|
||||
beq t2, x0, call_func
|
||||
RV_OP_LOADREG t5, 0(t1) /* load stack argument, t5 = argv[i] */
|
||||
RV_OP_STOREREG t5, 0(t4) /* store t5 to reseved stack, sp[j] = t5 */
|
||||
RV_OP_STOREREG t5, 0(t4) /* store t5 to reserved stack, sp[j] = t5 */
|
||||
addi t1, t1, RV_REG_SIZE /* move to next stack argument */
|
||||
addi t4, t4, RV_REG_SIZE /* move to next stack pointer */
|
||||
addi t2, t2, -1 /* decrease t2 every loop, nstacks = nstacks -1 */
|
||||
@ -142,7 +142,7 @@ call_func:
|
||||
/* restore registers pushed in stack or saved in another register */
|
||||
return:
|
||||
mv sp, fp /* restore sp saved in fp before function call */
|
||||
RV_OP_LOADREG fp, 0 * RV_REG_SIZE(sp) /* load previous frame poniter to fp register */
|
||||
RV_OP_LOADREG fp, 0 * RV_REG_SIZE(sp) /* load previous frame pointer to fp register */
|
||||
RV_OP_LOADREG ra, 1 * RV_REG_SIZE(sp) /* load previous return address to ra register */
|
||||
addi sp, sp, 2 * RV_REG_SIZE /* pop frame, restore sp */
|
||||
jr ra
|
||||
|
||||
@ -55,7 +55,7 @@ _invokeNative:
|
||||
vldr s13, [r4, #52]
|
||||
vldr s14, [r4, #56]
|
||||
vldr s15, [r4, #60]
|
||||
/* Directly call the fucntion if no args in stack */
|
||||
/* Directly call the function if no args in stack */
|
||||
cmp r5, #0
|
||||
beq call_func
|
||||
|
||||
|
||||
@ -118,7 +118,7 @@ execute_main(WASMModuleInstanceCommon *module_inst, int32 argc, char *argv[])
|
||||
|
||||
#if WASM_ENABLE_LIBC_WASI != 0
|
||||
/* In wasi mode, we should call the function named "_start"
|
||||
which initializes the wasi envrionment and then calls
|
||||
which initializes the wasi environment and then calls
|
||||
the actual main function. Directly calling main function
|
||||
may cause exception thrown. */
|
||||
if ((func = wasm_runtime_lookup_wasi_start_function(module_inst))) {
|
||||
|
||||
@ -2257,7 +2257,7 @@ wasm_module_new_ex(wasm_store_t *store, wasm_byte_vec_t *binary, LoadArgs *args)
|
||||
if (!store || !binary || binary->size == 0 || binary->size > UINT32_MAX)
|
||||
goto quit;
|
||||
|
||||
/* whether the combination of compilation flags are compatable with the
|
||||
/* whether the combination of compilation flags are compatible with the
|
||||
* package type */
|
||||
{
|
||||
PackageType pkg_type;
|
||||
|
||||
@ -202,7 +202,7 @@ wasm_exec_env_destroy(WASMExecEnv *exec_env)
|
||||
wasm_cluster_wait_for_all_except_self(cluster, exec_env);
|
||||
#if WASM_ENABLE_DEBUG_INTERP != 0
|
||||
/* Must fire exit event after other threads exits, otherwise
|
||||
the stopped thread will be overriden by other threads */
|
||||
the stopped thread will be overridden by other threads */
|
||||
wasm_cluster_thread_exited(exec_env);
|
||||
#endif
|
||||
/* We have waited for other threads, this is the only alive thread, so
|
||||
|
||||
@ -790,7 +790,7 @@ set_local_gc_ref(AOTCompFrame *frame, int n, LLVMValueRef value, uint8 ref_type)
|
||||
} \
|
||||
else { \
|
||||
char *func_name = #name; \
|
||||
/* AOT mode, delcare the function */ \
|
||||
/* AOT mode, declare the function */ \
|
||||
if (!(func = LLVMGetNamedFunction(func_ctx->module, func_name)) \
|
||||
&& !(func = LLVMAddFunction(func_ctx->module, func_name, \
|
||||
func_type))) { \
|
||||
|
||||
@ -3846,7 +3846,7 @@ aot_resolve_object_relocation_group(AOTObjectData *obj_data,
|
||||
}
|
||||
}
|
||||
|
||||
/* pares each relocation */
|
||||
/* parse each relocation */
|
||||
if (!(rel_itr = LLVMGetRelocations(rel_sec))) {
|
||||
aot_set_last_error("llvm get relocations failed.");
|
||||
return false;
|
||||
|
||||
@ -345,7 +345,7 @@ aot_check_memory_overflow(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
|
||||
memory allocator, the hmu node includes hmu header and hmu
|
||||
memory, only the latter is returned to the caller as the
|
||||
allocated memory, the hmu header isn't returned so the
|
||||
first byte of the shared heap won't be accesed, (2) using
|
||||
first byte of the shared heap won't be accessed, (2) using
|
||||
IntUGT gets better performance than IntUGE in some cases */
|
||||
BUILD_ICMP(LLVMIntUGT, offset1, func_ctx->shared_heap_start_off,
|
||||
is_in_shared_heap, "is_in_shared_heap");
|
||||
@ -1101,7 +1101,7 @@ aot_compile_op_memory_grow(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx)
|
||||
}
|
||||
else {
|
||||
char *func_name = "aot_enlarge_memory";
|
||||
/* AOT mode, delcare the function */
|
||||
/* AOT mode, declare the function */
|
||||
if (!(func = LLVMGetNamedFunction(func_ctx->module, func_name))
|
||||
&& !(func =
|
||||
LLVMAddFunction(func_ctx->module, func_name, func_type))) {
|
||||
@ -1184,7 +1184,7 @@ check_bulk_memory_overflow(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
|
||||
* Note: not throw the integer-overflow-exception here since it must
|
||||
* have been thrown when converting float to integer before
|
||||
*/
|
||||
/* return addres directly if constant offset and inside memory space */
|
||||
/* return address directly if constant offset and inside memory space */
|
||||
if (LLVMIsEfficientConstInt(offset) && LLVMIsEfficientConstInt(bytes)) {
|
||||
uint64 mem_offset = (uint64)LLVMConstIntGetZExtValue(offset);
|
||||
uint64 mem_len = (uint64)LLVMConstIntGetZExtValue(bytes);
|
||||
|
||||
@ -1720,7 +1720,7 @@ aot_create_stack_sizes(const AOTCompData *comp_data, AOTCompContext *comp_ctx)
|
||||
* This value is a placeholder, which will be replaced
|
||||
* after the corresponding functions are compiled.
|
||||
*
|
||||
* Don't use zeros becasue LLVM can optimize them to
|
||||
* Don't use zeros because LLVM can optimize them to
|
||||
* zeroinitializer.
|
||||
*/
|
||||
values[i] = I32_NEG_ONE;
|
||||
@ -2354,7 +2354,7 @@ create_target_machine_detect_host(AOTCompContext *comp_ctx)
|
||||
}
|
||||
|
||||
if (!LLVMTargetHasJIT(target)) {
|
||||
aot_set_last_error("unspported JIT on this platform.");
|
||||
aot_set_last_error("unsupported JIT on this platform.");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@ -3412,7 +3412,7 @@ aot_get_native_symbol_index(AOTCompContext *comp_ctx, const char *symbol)
|
||||
|
||||
sym = bh_list_first_elem(&comp_ctx->native_symbols);
|
||||
|
||||
/* Lookup an existing symobl record */
|
||||
/* Lookup an existing symbol record */
|
||||
|
||||
while (sym) {
|
||||
if (strcmp(sym->symbol, symbol) == 0) {
|
||||
|
||||
@ -17,7 +17,7 @@ endif()
|
||||
|
||||
set (IWASM_COMPL_SOURCE ${source_all})
|
||||
|
||||
# Disalbe rtti to works with LLVM
|
||||
# Disable rtti to works with LLVM
|
||||
|
||||
if (MSVC)
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR-")
|
||||
|
||||
@ -32,7 +32,7 @@ simd_integer_arith(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
|
||||
result = LLVMBuildMul(comp_ctx->builder, lhs, rhs, "product");
|
||||
break;
|
||||
default:
|
||||
HANDLE_FAILURE("Unsupport arith_op");
|
||||
HANDLE_FAILURE("Unsupported arith_op");
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@ -423,7 +423,7 @@ jmp_from_label_to_label(x86::Assembler &a, bh_list *jmp_info_list,
|
||||
|
||||
/**
|
||||
* Encode detecting compare result register according to condition code
|
||||
* and then jumping to suitable label when the condtion is met
|
||||
* and then jumping to suitable label when the condition is met
|
||||
*
|
||||
* @param cc the compiler context
|
||||
* @param a the assembler to emit the code
|
||||
@ -431,7 +431,7 @@ jmp_from_label_to_label(x86::Assembler &a, bh_list *jmp_info_list,
|
||||
* @param label_src the index of src label
|
||||
* @param op the opcode of condition operation
|
||||
* @param r1 the label info when condition is met
|
||||
* @param r2 the label info when condition is unmet, do nonthing if VOID
|
||||
* @param r2 the label info when condition is unmet, do nothing if VOID
|
||||
* @param is_last_insn if current insn is the last insn of current block
|
||||
*
|
||||
* @return true if success, false if failed
|
||||
@ -2589,7 +2589,7 @@ alu_r_r_r_i32(x86::Assembler &a, ALU_OP op, int32 reg_no_dst, int32 reg_no1_src,
|
||||
if (reg_no2_src == REG_EDX_IDX) {
|
||||
/* convert `REM_S edx, eax, edx` into
|
||||
`mov esi, edx` and `REM_S edx eax, rsi` to
|
||||
avoid overwritting edx when a.cdq() */
|
||||
avoid overwriting edx when a.cdq() */
|
||||
a.mov(regs_i32[REG_I32_FREE_IDX], regs_i32[REG_EDX_IDX]);
|
||||
reg_no2_src = REG_I32_FREE_IDX;
|
||||
}
|
||||
@ -2609,7 +2609,7 @@ alu_r_r_r_i32(x86::Assembler &a, ALU_OP op, int32 reg_no_dst, int32 reg_no1_src,
|
||||
if (reg_no2_src == REG_EDX_IDX) {
|
||||
/* convert `REM_U edx, eax, edx` into
|
||||
`mov esi, edx` and `REM_U edx eax, rsi` to
|
||||
avoid overwritting edx when unsigned extend
|
||||
avoid overwriting edx when unsigned extend
|
||||
eax to edx:eax */
|
||||
a.mov(regs_i32[REG_I32_FREE_IDX], regs_i32[REG_EDX_IDX]);
|
||||
reg_no2_src = REG_I32_FREE_IDX;
|
||||
@ -5602,7 +5602,7 @@ fail:
|
||||
a.jmp(imm); \
|
||||
if (!err_handler->err) { \
|
||||
/* The offset written by asmjit is always 0, we patch it \
|
||||
again, 6 is the size of jmp instruciton */ \
|
||||
again, 6 is the size of jmp instruction */ \
|
||||
stream = (char *)a.code()->sectionById(0)->buffer().data() \
|
||||
+ a.code()->sectionById(0)->buffer().size() - 6; \
|
||||
_offset = label_offsets[label_dst] \
|
||||
@ -6169,7 +6169,7 @@ fail:
|
||||
* Replace all the jmp address pre-saved when the code cache hasn't been
|
||||
* allocated with actual address after code cache allocated
|
||||
*
|
||||
* @param cc compiler context containting the allocated code cacha info
|
||||
* @param cc compiler context containing the allocated code cacha info
|
||||
* @param jmp_info_list the jmp info list
|
||||
*/
|
||||
static void
|
||||
@ -6557,7 +6557,7 @@ at_cmpxchg_r_ra_base_r_offset_imm(x86::Assembler &a, uint32 bytes_dst,
|
||||
* @param a the assembler to emit the code
|
||||
* @param bytes_dst the bytes number of the data to actual operated on(load,
|
||||
* compare, replacement) could be 1(byte), 2(short), 4(int32), 8(int64)
|
||||
* @param data_xchg the immediate data for exchange(conditionally replacment
|
||||
* @param data_xchg the immediate data for exchange(conditionally replacement
|
||||
* value)
|
||||
* @param reg_no_base the no of register that stores the base address
|
||||
* of src&dst memory
|
||||
@ -6587,7 +6587,7 @@ at_cmpxchg_imm_ra_base_r_offset_r(x86::Assembler &a, uint32 bytes_dst,
|
||||
* @param a the assembler to emit the code
|
||||
* @param bytes_dst the bytes number of the data to actual operated on(load,
|
||||
* compare, replacement) could be 1(byte), 2(short), 4(int32), 8(int64)
|
||||
* @param data_xchg the immediate data for exchange(conditionally replacment
|
||||
* @param data_xchg the immediate data for exchange(conditionally replacement
|
||||
* value)
|
||||
* @param reg_no_base the no of register that stores the base address
|
||||
* of src&dst memory
|
||||
@ -8820,7 +8820,7 @@ jit_codegen_compile_call_to_fast_jit(const WASMModule *module, uint32 func_idx)
|
||||
|
||||
/* If yes, set eax to 0, return to caller */
|
||||
|
||||
/* Pop all integer arument registers */
|
||||
/* Pop all integer argument registers */
|
||||
for (i = 0; i < MAX_REG_INTS; i++) {
|
||||
a.pop(regs_i64[reg_idx_of_int_args[i]]);
|
||||
}
|
||||
@ -9084,7 +9084,7 @@ jit_codegen_compile_call_to_fast_jit(const WASMModule *module, uint32 func_idx)
|
||||
a.mov(m, x86::rdx);
|
||||
}
|
||||
|
||||
/* Pop all integer arument registers */
|
||||
/* Pop all integer argument registers */
|
||||
for (i = 0; i < MAX_REG_INTS; i++) {
|
||||
a.pop(regs_i64[reg_idx_of_int_args[i]]);
|
||||
}
|
||||
|
||||
@ -14,7 +14,7 @@ jit_compile_op_compare_integer(JitCompContext *cc, IntCond cond, bool is64Bit)
|
||||
JitReg lhs, rhs, res, const_zero, const_one;
|
||||
|
||||
if (cond < INT_EQZ || cond > INT_GE_U) {
|
||||
jit_set_last_error(cc, "unsupported comparation operation");
|
||||
jit_set_last_error(cc, "unsupported comparison operation");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
||||
@ -1230,7 +1230,7 @@ jit_compile_op_br_table(JitCompContext *cc, uint32 *br_depths, uint32 br_count,
|
||||
copy_arities = check_copy_arities(block_dst, cc->jit_frame);
|
||||
|
||||
if (!copy_arities) {
|
||||
/* No need to create new basic block, direclty jump to
|
||||
/* No need to create new basic block, directly jump to
|
||||
the existing basic block when no need to copy arities */
|
||||
if (i == br_count) {
|
||||
if (block_dst->label_type == LABEL_TYPE_LOOP) {
|
||||
|
||||
@ -31,7 +31,7 @@ get_global_base_offset(const WASMModule *module)
|
||||
* (module->import_memory_count + module->memory_count);
|
||||
|
||||
#if WASM_ENABLE_JIT != 0
|
||||
/* If the module dosen't have memory, reserve one mem_info space
|
||||
/* If the module doesn't have memory, reserve one mem_info space
|
||||
with empty content to align with llvm jit compiler */
|
||||
if (mem_inst_size == 0)
|
||||
mem_inst_size = (uint32)sizeof(WASMMemoryInstance);
|
||||
@ -1169,7 +1169,7 @@ init_func_translation(JitCompContext *cc)
|
||||
time_started = jit_cc_new_reg_I64(cc);
|
||||
/* Call os_time_thread_cputime_us() to get time_started firstly
|
||||
as there is stack frame switching below, calling native in them
|
||||
may cause register spilling work inproperly */
|
||||
may cause register spilling work improperly */
|
||||
if (!jit_emit_callnative(cc, os_time_thread_cputime_us, time_started, NULL,
|
||||
0)) {
|
||||
return NULL;
|
||||
|
||||
@ -94,7 +94,7 @@ typedef uint32 JitReg;
|
||||
/*
|
||||
* Constant index flag of non-constant-value (constant value flag is
|
||||
* not set in register no. field) integer, floating point and vector
|
||||
* regisers. If this flag is set, the rest bits of the register
|
||||
* registers. If this flag is set, the rest bits of the register
|
||||
* no. represent an index to the constant value table of the
|
||||
* corresponding type of the register and the register is read-only.
|
||||
*/
|
||||
@ -1084,7 +1084,7 @@ typedef struct JitCompContext {
|
||||
/* Capacity of register annotations of each kind. */
|
||||
uint32 _capacity[JIT_REG_KIND_L32];
|
||||
|
||||
/* Constant vallues of each kind. */
|
||||
/* Constant values of each kind. */
|
||||
uint8 *_value[JIT_REG_KIND_L32];
|
||||
|
||||
/* Next element on the list of values with the same hash code. */
|
||||
@ -1145,7 +1145,7 @@ typedef struct JitCompContext {
|
||||
JitInsn **_table;
|
||||
} _insn_hash_table;
|
||||
|
||||
/* indicate if the last comparision is about floating-point numbers or not
|
||||
/* indicate if the last comparison is about floating-point numbers or not
|
||||
*/
|
||||
bool last_cmp_on_fp;
|
||||
} JitCompContext;
|
||||
@ -1203,7 +1203,7 @@ typedef struct JitCompContext {
|
||||
* Annotation disabling functions jit_annl_disable_NAME,
|
||||
* jit_anni_disable_NAME and jit_annr_disable_NAME, which release
|
||||
* memory of the annotations. Before calling these functions,
|
||||
* resources owned by the annotations must be explictely released.
|
||||
* resources owned by the annotations must be explicitly released.
|
||||
*/
|
||||
#define ANN_LABEL(TYPE, NAME) void jit_annl_disable_##NAME(JitCompContext *cc);
|
||||
#define ANN_INSN(TYPE, NAME) void jit_anni_disable_##NAME(JitCompContext *cc);
|
||||
@ -1559,7 +1559,7 @@ _jit_cc_new_insn_norm(JitCompContext *cc, JitReg *result, JitInsn *insn);
|
||||
*
|
||||
* @param cc the compilationo context
|
||||
* @param result returned result of the instruction. If the value is
|
||||
* non-zero, it is the result of the constant-folding or an exsiting
|
||||
* non-zero, it is the result of the constant-folding or an existing
|
||||
* equivalent instruction, in which case no instruction is added into
|
||||
* the compilation context. Otherwise, a new normalized instruction
|
||||
* has been added into the compilation context.
|
||||
|
||||
@ -221,7 +221,7 @@ get_reg_stride(JitReg reg)
|
||||
* @param rc the regalloc context
|
||||
* @param vreg the virtual register
|
||||
*
|
||||
* @return the spill slot encoded in a consant register
|
||||
* @return the spill slot encoded in a constant register
|
||||
*/
|
||||
static JitReg
|
||||
rc_alloc_spill_slot(RegallocContext *rc, JitReg vreg)
|
||||
@ -478,7 +478,7 @@ reload_vreg(RegallocContext *rc, JitReg vreg, JitInsn *cur_insn)
|
||||
JitReg fp_reg = rc->cc->fp_reg, offset;
|
||||
|
||||
if (!vr->slot && !(vr->slot = rc_alloc_spill_slot(rc, vreg)))
|
||||
/* Cannot allocte spill slot (due to OOM or frame size limit). */
|
||||
/* Cannot allocate spill slot (due to OOM or frame size limit). */
|
||||
return NULL;
|
||||
|
||||
offset = offset_of_spill_slot(rc->cc, vr->slot);
|
||||
@ -579,7 +579,7 @@ spill_vreg(RegallocContext *rc, JitReg vreg, JitInsn *cur_insn)
|
||||
|
||||
/**
|
||||
* Allocate a hard register for the virtual register. Necessary
|
||||
* reloade instruction will be inserted after the given instruction.
|
||||
* reload instruction will be inserted after the given instruction.
|
||||
*
|
||||
* @param rc the regalloc context
|
||||
* @param vreg the virtual register
|
||||
@ -665,7 +665,7 @@ allocate_hreg(RegallocContext *rc, JitReg vreg, JitInsn *insn, int distance)
|
||||
|
||||
/**
|
||||
* Allocate a hard register for the virtual register if not allocated
|
||||
* yet. Necessary spill and reloade instructions will be inserted
|
||||
* yet. Necessary spill and reload instructions will be inserted
|
||||
* before/after and after the given instruction. This operation will
|
||||
* convert the virtual register's state from 1 or 3 to 2.
|
||||
*
|
||||
|
||||
@ -2283,7 +2283,7 @@ wasm_runtime_detach_shared_heap(wasm_module_inst_t module_inst);
|
||||
* @param size required memory size
|
||||
* @param p_native_addr native address of allocated memory
|
||||
*
|
||||
* @return return the allocated memory address, which re-uses part of the wasm
|
||||
* @return return the allocated memory address, which reuses part of the wasm
|
||||
* address space and is in the range of [UINT32 - shared_heap_size + 1, UINT32]
|
||||
* (when the wasm memory is 32-bit) or [UINT64 - shared_heap_size + 1, UINT64]
|
||||
* (when the wasm memory is 64-bit). Note that it is not an absolute address.
|
||||
|
||||
@ -1934,7 +1934,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
|
||||
UNWIND_CSP(relative_depth, LABEL_TYPE_FUNCTION);
|
||||
/* push exception values for catch
|
||||
* The values are copied to the CALLER FRAME
|
||||
* (prev_frame->sp) same behvior ad WASM_OP_RETURN
|
||||
* (prev_frame->sp) same behavior ad WASM_OP_RETURN
|
||||
*/
|
||||
if (cell_num_to_copy > 0) {
|
||||
word_copy(prev_frame->sp,
|
||||
@ -4963,7 +4963,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
|
||||
HANDLE_OP_END();
|
||||
}
|
||||
|
||||
/* numberic instructions of i32 */
|
||||
/* numeric instructions of i32 */
|
||||
HANDLE_OP(WASM_OP_I32_CLZ)
|
||||
{
|
||||
DEF_OP_BIT_COUNT(uint32, I32, clz32);
|
||||
@ -5120,7 +5120,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
|
||||
HANDLE_OP_END();
|
||||
}
|
||||
|
||||
/* numberic instructions of i64 */
|
||||
/* numeric instructions of i64 */
|
||||
HANDLE_OP(WASM_OP_I64_CLZ)
|
||||
{
|
||||
DEF_OP_BIT_COUNT(uint64, I64, clz64);
|
||||
@ -5277,7 +5277,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
|
||||
HANDLE_OP_END();
|
||||
}
|
||||
|
||||
/* numberic instructions of f32 */
|
||||
/* numeric instructions of f32 */
|
||||
HANDLE_OP(WASM_OP_F32_ABS)
|
||||
{
|
||||
DEF_OP_MATH(float32, F32, fabsf);
|
||||
@ -5381,7 +5381,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
|
||||
HANDLE_OP_END();
|
||||
}
|
||||
|
||||
/* numberic instructions of f64 */
|
||||
/* numeric instructions of f64 */
|
||||
HANDLE_OP(WASM_OP_F64_ABS)
|
||||
{
|
||||
DEF_OP_MATH(float64, F64, fabs);
|
||||
@ -6680,7 +6680,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
|
||||
tag++, t++) {
|
||||
|
||||
/* compare the module and the external index with the
|
||||
* imort tag data */
|
||||
* import tag data */
|
||||
if ((cur_func->u.func_import->import_module
|
||||
== tag->u.tag_import->import_module)
|
||||
&& (ext_exception
|
||||
|
||||
@ -4149,7 +4149,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
|
||||
HANDLE_OP_END();
|
||||
}
|
||||
|
||||
/* numberic instructions of i32 */
|
||||
/* numeric instructions of i32 */
|
||||
HANDLE_OP(WASM_OP_I32_CLZ)
|
||||
{
|
||||
DEF_OP_BIT_COUNT(uint32, I32, clz32);
|
||||
@ -4319,7 +4319,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
|
||||
HANDLE_OP_END();
|
||||
}
|
||||
|
||||
/* numberic instructions of i64 */
|
||||
/* numeric instructions of i64 */
|
||||
HANDLE_OP(WASM_OP_I64_CLZ)
|
||||
{
|
||||
DEF_OP_BIT_COUNT(uint64, I64, clz64);
|
||||
@ -4476,7 +4476,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
|
||||
HANDLE_OP_END();
|
||||
}
|
||||
|
||||
/* numberic instructions of f32 */
|
||||
/* numeric instructions of f32 */
|
||||
HANDLE_OP(WASM_OP_F32_ABS)
|
||||
{
|
||||
DEF_OP_MATH(float32, F32, fabsf);
|
||||
@ -4581,7 +4581,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
|
||||
HANDLE_OP_END();
|
||||
}
|
||||
|
||||
/* numberic instructions of f64 */
|
||||
/* numeric instructions of f64 */
|
||||
HANDLE_OP(WASM_OP_F64_ABS)
|
||||
{
|
||||
DEF_OP_MATH(float64, F64, fabs);
|
||||
|
||||
@ -399,7 +399,7 @@ check_array_type(const WASMModule *module, uint32 type_index, char *error_buf,
|
||||
return false;
|
||||
}
|
||||
if (module->types[type_index]->type_flag != WASM_TYPE_ARRAY) {
|
||||
set_error_buf(error_buf, error_buf_size, "unkown array type");
|
||||
set_error_buf(error_buf, error_buf_size, "unknown array type");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -954,7 +954,7 @@ load_init_expr(WASMModule *module, const uint8 **p_buf, const uint8 *buf_end,
|
||||
if (struct_type->base_type.type_flag
|
||||
!= WASM_TYPE_STRUCT) {
|
||||
set_error_buf(error_buf, error_buf_size,
|
||||
"unkown struct type");
|
||||
"unknown struct type");
|
||||
goto fail;
|
||||
}
|
||||
field_count = struct_type->field_count;
|
||||
@ -1020,7 +1020,7 @@ load_init_expr(WASMModule *module, const uint8 **p_buf, const uint8 *buf_end,
|
||||
if (module->types[type_idx]->type_flag
|
||||
!= WASM_TYPE_STRUCT) {
|
||||
set_error_buf(error_buf, error_buf_size,
|
||||
"unkown struct type");
|
||||
"unknown struct type");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@ -1059,7 +1059,7 @@ load_init_expr(WASMModule *module, const uint8 **p_buf, const uint8 *buf_end,
|
||||
if (array_type->base_type.type_flag
|
||||
!= WASM_TYPE_ARRAY) {
|
||||
set_error_buf(error_buf, error_buf_size,
|
||||
"unkown array type");
|
||||
"unknown array type");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@ -11420,7 +11420,7 @@ re_scan:
|
||||
if (!check_offset_push(loader_ctx, error_buf,
|
||||
error_buf_size))
|
||||
goto fail;
|
||||
/* for following dummy value assignemnt */
|
||||
/* for following dummy value assignment */
|
||||
loader_ctx->frame_offset -= cell_num;
|
||||
}
|
||||
|
||||
@ -11732,7 +11732,7 @@ re_scan:
|
||||
*/
|
||||
cur_block->label_type = LABEL_TYPE_CATCH;
|
||||
|
||||
/* RESET_STACK removes the values pushed in TRY or pervious
|
||||
/* RESET_STACK removes the values pushed in TRY or previous
|
||||
* CATCH Blocks */
|
||||
RESET_STACK();
|
||||
|
||||
@ -11774,7 +11774,7 @@ re_scan:
|
||||
/* replace frame_csp by LABEL_TYPE_CATCH_ALL */
|
||||
cur_block->label_type = LABEL_TYPE_CATCH_ALL;
|
||||
|
||||
/* RESET_STACK removes the values pushed in TRY or pervious
|
||||
/* RESET_STACK removes the values pushed in TRY or previous
|
||||
* CATCH Blocks */
|
||||
RESET_STACK();
|
||||
|
||||
@ -12128,7 +12128,7 @@ re_scan:
|
||||
}
|
||||
if (module->types[type_idx1]->type_flag != WASM_TYPE_FUNC) {
|
||||
set_error_buf(error_buf, error_buf_size,
|
||||
"unkown function type");
|
||||
"unknown function type");
|
||||
goto fail;
|
||||
}
|
||||
if (!wasm_loader_pop_nullable_typeidx(loader_ctx, &type,
|
||||
@ -12145,7 +12145,7 @@ re_scan:
|
||||
}
|
||||
if (module->types[type_idx]->type_flag != WASM_TYPE_FUNC) {
|
||||
set_error_buf(error_buf, error_buf_size,
|
||||
"unkown function type");
|
||||
"unknown function type");
|
||||
goto fail;
|
||||
}
|
||||
if (!wasm_func_type_is_super_of(
|
||||
@ -13911,7 +13911,7 @@ re_scan:
|
||||
if (module->types[type_idx]->type_flag
|
||||
!= WASM_TYPE_STRUCT) {
|
||||
set_error_buf(error_buf, error_buf_size,
|
||||
"unkown struct type");
|
||||
"unknown struct type");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
||||
@ -2457,7 +2457,7 @@ orcjit_thread_callback(void *arg)
|
||||
i + j * group_stride + module->import_function_count,
|
||||
(void *)func_addr);
|
||||
|
||||
/* Try to switch to call this llvm jit funtion instead of
|
||||
/* Try to switch to call this llvm jit function instead of
|
||||
fast jit function from fast jit jitted code */
|
||||
jit_compiler_set_call_to_llvm_jit(
|
||||
module,
|
||||
|
||||
@ -991,7 +991,7 @@ __wasi_sock_get_ipv6_only(__wasi_fd_t fd, bool *option)
|
||||
/**
|
||||
* TODO: modify recv() and send()
|
||||
* since don't want to re-compile the wasi-libc,
|
||||
* we tend to keep original implentations of recv() and send().
|
||||
* we tend to keep original implementations of recv() and send().
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@ -65,7 +65,7 @@ test(int iter_num, int max_threads_num, int retry_num, int retry_time_us)
|
||||
}
|
||||
|
||||
while ((__atomic_load_n(&threads_in_use, __ATOMIC_SEQ_CST) != 0)) {
|
||||
// Casting to int* to supress compiler warning
|
||||
// Casting to int* to suppress compiler warning
|
||||
__builtin_wasm_memory_atomic_wait32((int *)(&threads_in_use), 0,
|
||||
second_us);
|
||||
}
|
||||
|
||||
@ -26,7 +26,7 @@ typedef __wasi_dircookie_t wasi_dircookie_t;
|
||||
// result are not guaranteed to be zero'ed by us so the result essentially
|
||||
// contains garbage from the WASM app perspective. To prevent this, we return
|
||||
// uint32 directly instead so as not to be reliant on the correct behaviour of
|
||||
// any current/future WASI SDK implemenations.
|
||||
// any current/future WASI SDK implementations.
|
||||
typedef uint32_t wasi_errno_t;
|
||||
typedef __wasi_event_t wasi_event_t;
|
||||
typedef __wasi_exitcode_t wasi_exitcode_t;
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* The defitions of type, macro and structure in this file should be
|
||||
* The definitions of type, macro and structure in this file should be
|
||||
* consistent with those in wasi-libc:
|
||||
* https://github.com/WebAssembly/wasi-libc/blob/main/libc-bottom-half/headers/public/wasi/api.h
|
||||
*/
|
||||
|
||||
@ -14,7 +14,7 @@ extern char const *LLAMA_COMMIT;
|
||||
extern char const *LLAMA_COMPILER;
|
||||
extern char const *LLAMA_BUILD_TARGET;
|
||||
|
||||
// compatable with WasmEdge
|
||||
// compatible with WasmEdge
|
||||
// https://github.com/second-state/WasmEdge-WASINN-examples/blob/master/wasmedge-ggml/README.md#parameters
|
||||
// https://github.com/WasmEdge/WasmEdge/blob/master/plugins/wasi_nn/ggml.cpp
|
||||
struct wasi_nn_llama_config {
|
||||
|
||||
@ -56,7 +56,7 @@ initialize_g(TFLiteContext *tfl_ctx, graph *g)
|
||||
os_mutex_lock(&tfl_ctx->g_lock);
|
||||
if (tfl_ctx->current_models == MAX_GRAPHS_PER_INST) {
|
||||
os_mutex_unlock(&tfl_ctx->g_lock);
|
||||
NN_ERR_PRINTF("Excedded max graphs per WASM instance");
|
||||
NN_ERR_PRINTF("Exceeded max graphs per WASM instance");
|
||||
return runtime_error;
|
||||
}
|
||||
*g = tfl_ctx->current_models++;
|
||||
@ -70,7 +70,7 @@ initialize_graph_ctx(TFLiteContext *tfl_ctx, graph g,
|
||||
os_mutex_lock(&tfl_ctx->g_lock);
|
||||
if (tfl_ctx->current_interpreters == MAX_GRAPH_EXEC_CONTEXTS_PER_INST) {
|
||||
os_mutex_unlock(&tfl_ctx->g_lock);
|
||||
NN_ERR_PRINTF("Excedded max graph execution context per WASM instance");
|
||||
NN_ERR_PRINTF("Exceeded max graph execution context per WASM instance");
|
||||
return runtime_error;
|
||||
}
|
||||
*ctx = tfl_ctx->current_interpreters++;
|
||||
@ -325,7 +325,7 @@ set_input(void *tflite_ctx, graph_execution_context ctx, uint32_t index,
|
||||
int size = model_tensor_size * sizeof(float);
|
||||
bh_memcpy_s(it, size, input_tensor->data, size);
|
||||
}
|
||||
else { // TODO: Assumming uint8 quantized networks.
|
||||
else { // TODO: Assuming uint8 quantized networks.
|
||||
TfLiteAffineQuantization *quant_info =
|
||||
(TfLiteAffineQuantization *)tensor->quantization.params;
|
||||
if (quant_info->scale->size != 1 || quant_info->zero_point->size != 1) {
|
||||
@ -406,7 +406,7 @@ get_output(void *tflite_ctx, graph_execution_context ctx, uint32_t index,
|
||||
int size = model_tensor_size * sizeof(float);
|
||||
bh_memcpy_s(output_tensor, size, ot, size);
|
||||
}
|
||||
else { // TODO: Assumming uint8 quantized networks.
|
||||
else { // TODO: Assuming uint8 quantized networks.
|
||||
TfLiteAffineQuantization *quant_info =
|
||||
(TfLiteAffineQuantization *)tensor->quantization.params;
|
||||
if (quant_info->scale->size != 1 || quant_info->zero_point->size != 1) {
|
||||
|
||||
@ -286,7 +286,7 @@ def execute_wasmedge_ggml_qwen(iwasm_bin: str, wasmedge_bin: str, cwd: Path):
|
||||
|
||||
p.stdin.write(b"hi\n")
|
||||
p.stdin.flush()
|
||||
# ASSITANT
|
||||
# ASSISTANT
|
||||
p.stdout.readline()
|
||||
# xxx
|
||||
p.stdout.readline()
|
||||
@ -296,7 +296,7 @@ def execute_wasmedge_ggml_qwen(iwasm_bin: str, wasmedge_bin: str, cwd: Path):
|
||||
p.stdin.write(prompt.encode())
|
||||
p.stdin.write(b"\n")
|
||||
p.stdin.flush()
|
||||
# ASSITANT
|
||||
# ASSISTANT
|
||||
p.stdout.readline()
|
||||
# xxx
|
||||
answer = p.stdout.readline().decode("utf-8")
|
||||
|
||||
@ -40,7 +40,7 @@ hmu_is_in_heap(void *hmu, gc_uint8 *heap_base_addr, gc_uint8 *heap_end_addr)
|
||||
* the node will be removed from the tree, and the left, right and
|
||||
* parent pointers of the node @p will be set to be NULL. Other fields
|
||||
* won't be touched. The tree will be re-organized so that the order
|
||||
* conditions are still satisified.
|
||||
* conditions are still satisfied.
|
||||
*/
|
||||
static bool
|
||||
remove_tree_node(gc_heap_t *heap, hmu_tree_node_t *p)
|
||||
@ -648,7 +648,7 @@ gc_realloc_vo_internal(void *vheap, void *ptr, gc_size_t size, const char *file,
|
||||
hmu_old = obj_to_hmu(obj_old);
|
||||
tot_size_old = hmu_get_size(hmu_old);
|
||||
if (tot_size <= tot_size_old)
|
||||
/* current node alreay meets requirement */
|
||||
/* current node already meets requirement */
|
||||
return obj_old;
|
||||
}
|
||||
|
||||
|
||||
@ -115,7 +115,7 @@ gc_init_with_struct_and_pool(char *struct_buf, gc_size_t struct_buf_size,
|
||||
char *pool_buf, gc_size_t pool_buf_size);
|
||||
|
||||
/**
|
||||
* Destroy heap which is initilized from a buffer
|
||||
* Destroy heap which is initialized from a buffer
|
||||
*
|
||||
* @param handle handle to heap needed destroy
|
||||
*
|
||||
|
||||
@ -287,7 +287,7 @@ typedef struct gc_heap_struct {
|
||||
additional memory fails. When the fast mode fails, the
|
||||
marking process can still be done in the slow mode, which
|
||||
doesn't need additional memory (by walking through all
|
||||
blocks and marking sucessors of marked nodes until no new
|
||||
blocks and marking successors of marked nodes until no new
|
||||
node is marked). TODO: slow mode is not implemented. */
|
||||
unsigned is_fast_marking_failed : 1;
|
||||
|
||||
@ -319,7 +319,7 @@ typedef struct gc_heap_struct {
|
||||
* the nodes, a new space will be allocated from heap */
|
||||
extra_info_node_t *extra_info_normal_nodes[EXTRA_INFO_NORMAL_NODE_CNT];
|
||||
/* Used to store extra information such as finalizer for specified nodes, we
|
||||
* introduce a seperate space to store these information so only nodes who
|
||||
* introduce a separate space to store these information so only nodes who
|
||||
* really require extra information will occupy additional memory spaces. */
|
||||
extra_info_node_t **extra_info_nodes;
|
||||
gc_size_t extra_info_node_cnt;
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
|
||||
/**
|
||||
* Set default value to prefix and suffix
|
||||
* @param hmu should not be NULL and should have been correctly initilized
|
||||
* @param hmu should not be NULL and should have been correctly initialized
|
||||
* (except prefix and suffix part)
|
||||
* @param tot_size is offered here because hmu_get_size can not be used
|
||||
* till now. tot_size should not be smaller than OBJ_EXTRA_SIZE.
|
||||
|
||||
@ -232,7 +232,7 @@ gc_migrate(gc_handle_t handle, char *pool_buf_new, gc_size_t pool_buf_size)
|
||||
heap_max_size = (uint32)(pool_buf_end - base_addr_new) & (uint32)~7;
|
||||
|
||||
if (pool_buf_end < base_addr_new || heap_max_size < heap->current_size) {
|
||||
LOG_ERROR("[GC_ERROR]heap migrate invlaid pool buf size\n");
|
||||
LOG_ERROR("[GC_ERROR]heap migrate invalid pool buf size\n");
|
||||
return GC_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@ -495,7 +495,7 @@ os_thread_jit_write_protect_np(bool enabled)
|
||||
#define SIG_ALT_STACK_SIZE (32 * 1024)
|
||||
|
||||
/**
|
||||
* Whether thread signal enviornment is initialized:
|
||||
* Whether thread signal environment is initialized:
|
||||
* the signal handler is registered, the stack pages are touched,
|
||||
* the stack guard pages are set and signal alternate stack are set.
|
||||
*/
|
||||
@ -696,7 +696,7 @@ os_thread_signal_init(os_signal_handler handler)
|
||||
memset(&prev_sig_act_SIGSEGV, 0, sizeof(struct sigaction));
|
||||
memset(&prev_sig_act_SIGBUS, 0, sizeof(struct sigaction));
|
||||
|
||||
/* Install signal hanlder */
|
||||
/* Install signal handler */
|
||||
sig_act.sa_sigaction = signal_callback;
|
||||
sig_act.sa_flags = SA_SIGINFO | SA_NODEFER;
|
||||
#if WASM_DISABLE_STACK_HW_BOUND_CHECK == 0
|
||||
|
||||
@ -209,7 +209,7 @@ int
|
||||
os_cond_wait(korp_cond *cond, korp_mutex *mutex);
|
||||
|
||||
/**
|
||||
* Wait a condition varible or return if time specified passes.
|
||||
* Wait a condition variable or return if time specified passes.
|
||||
*
|
||||
* @param cond pointer to condition variable
|
||||
* @param mutex pointer to mutex to protect the condition variable
|
||||
@ -766,7 +766,7 @@ int
|
||||
os_socket_get_recv_timeout(bh_socket_t socket, uint64 *timeout_us);
|
||||
|
||||
/**
|
||||
* Enable re-use of local addresses
|
||||
* Enable reuse of local addresses
|
||||
*
|
||||
* @param socket the socket to set
|
||||
* @param is_enabled 1 to enable or 0 to disable
|
||||
@ -777,7 +777,7 @@ int
|
||||
os_socket_set_reuse_addr(bh_socket_t socket, bool is_enabled);
|
||||
|
||||
/**
|
||||
* Get whether re-use of local addresses is enabled
|
||||
* Get whether reuse of local addresses is enabled
|
||||
*
|
||||
* @param socket the socket to set
|
||||
* @param is_enabled 1 for enabled or 0 for disabled
|
||||
@ -788,7 +788,7 @@ int
|
||||
os_socket_get_reuse_addr(bh_socket_t socket, bool *is_enabled);
|
||||
|
||||
/**
|
||||
* Enable re-use of local ports
|
||||
* Enable reuse of local ports
|
||||
*
|
||||
* @param socket the socket to set
|
||||
* @param is_enabled 1 to enable or 0 to disable
|
||||
@ -799,7 +799,7 @@ int
|
||||
os_socket_set_reuse_port(bh_socket_t socket, bool is_enabled);
|
||||
|
||||
/**
|
||||
* Get whether re-use of local ports is enabled
|
||||
* Get whether reuse of local ports is enabled
|
||||
*
|
||||
* @param socket the socket to set
|
||||
* @param is_enabled 1 for enabled or 0 for disabled
|
||||
@ -1120,7 +1120,7 @@ os_dumps_proc_mem_info(char *out, unsigned int size);
|
||||
|
||||
/**
|
||||
* NOTES:
|
||||
* Fileystem APIs are required for WASI libc support. If you don't need to
|
||||
* Filesystem APIs are required for WASI libc support. If you don't need to
|
||||
* support WASI libc, there is no need to implement these APIs. With a
|
||||
* few exceptions, each filesystem function has been named after the equivalent
|
||||
* POSIX filesystem function with an os_ prefix.
|
||||
@ -1134,12 +1134,12 @@ os_dumps_proc_mem_info(char *out, unsigned int size);
|
||||
* os_file_handle: the file handle type used in the WASI libc fd
|
||||
* table. Filesystem implementations can use it as a means to store any
|
||||
* necessary platform-specific information which may not be directly available
|
||||
* through the raw OS file handle. Similiar to POSIX file descriptors, file
|
||||
* through the raw OS file handle. Similar to POSIX file descriptors, file
|
||||
* handles may also refer to sockets, directories, symbolic links or character
|
||||
* devices and any of the filesystem operations which make sense for these
|
||||
* resource types should be supported as far as possible.
|
||||
*
|
||||
* os_dir_stream: a directory stream type in which fileystem implementations
|
||||
* os_dir_stream: a directory stream type in which filesystem implementations
|
||||
* can store any necessary state to iterate over the entries in a directory.
|
||||
*/
|
||||
|
||||
@ -1166,7 +1166,7 @@ os_fstatat(os_file_handle handle, const char *path,
|
||||
struct __wasi_filestat_t *buf, __wasi_lookupflags_t lookup_flags);
|
||||
|
||||
/**
|
||||
* Obtain the file status flags for the provided handle. This is similiar to the
|
||||
* Obtain the file status flags for the provided handle. This is similar to the
|
||||
* POSIX function fcntl called with the F_GETFL command.
|
||||
*
|
||||
* @param handle the handle for which to obtain the file status flags
|
||||
@ -1176,7 +1176,7 @@ __wasi_errno_t
|
||||
os_file_get_fdflags(os_file_handle handle, __wasi_fdflags_t *flags);
|
||||
|
||||
/**
|
||||
* Set the file status flags for the provided handle. This is similiar to the
|
||||
* Set the file status flags for the provided handle. This is similar to the
|
||||
* POSIX function fcntl called with the F_SETFL command.
|
||||
*
|
||||
* @param handle the handle for which to set the file status flags
|
||||
@ -1235,7 +1235,7 @@ os_openat(os_file_handle handle, const char *path, __wasi_oflags_t oflags,
|
||||
wasi_libc_file_access_mode access_mode, os_file_handle *out);
|
||||
|
||||
/**
|
||||
* Obtain the file access mode for the provided handle. This is similiar to the
|
||||
* Obtain the file access mode for the provided handle. This is similar to the
|
||||
* POSIX function fcntl called with the F_GETFL command combined with the
|
||||
* O_ACCMODE mask.
|
||||
*
|
||||
@ -1480,9 +1480,9 @@ os_file_handle
|
||||
os_convert_stdin_handle(os_raw_file_handle raw_stdin);
|
||||
|
||||
/**
|
||||
* Converts a raw file handle to STDOUT to a correponding file handle to STDOUT.
|
||||
* If the provided raw file handle is invalid, the platform-default raw handle
|
||||
* for STDOUT will be used.
|
||||
* Converts a raw file handle to STDOUT to a corresponding file handle to
|
||||
* STDOUT. If the provided raw file handle is invalid, the platform-default raw
|
||||
* handle for STDOUT will be used.
|
||||
*
|
||||
* @param raw_stdout a raw file handle to STDOUT
|
||||
*
|
||||
@ -1492,9 +1492,9 @@ os_file_handle
|
||||
os_convert_stdout_handle(os_raw_file_handle raw_stdout);
|
||||
|
||||
/**
|
||||
* Converts a raw file handle to STDERR to a correponding file handle to STDERR.
|
||||
* If the provided raw file handle is invalid, the platform-default raw handle
|
||||
* for STDERR will be used.
|
||||
* Converts a raw file handle to STDERR to a corresponding file handle to
|
||||
* STDERR. If the provided raw file handle is invalid, the platform-default raw
|
||||
* handle for STDERR will be used.
|
||||
*
|
||||
* @param raw_stderr a raw file handle to STDERR
|
||||
*
|
||||
|
||||
@ -53,7 +53,7 @@ convert_sgx_errno(int error)
|
||||
* continue (only used when no EXXX is returned) */
|
||||
case SGX_ERROR_FILE_CANT_WRITE_RECOVERY_FILE:
|
||||
return EIO;
|
||||
/* When openeing the file, recovery is needed, but the recovery
|
||||
/* When opening the file, recovery is needed, but the recovery
|
||||
* process failed */
|
||||
case SGX_ERROR_FILE_RECOVERY_NEEDED:
|
||||
return EIO;
|
||||
|
||||
@ -51,7 +51,7 @@ extern "C" {
|
||||
#define TCP_DEFER_ACCEPT 9 /* Wake up listener only when data arrive */
|
||||
#define TCP_WINDOW_CLAMP 10 /* Bound advertised window */
|
||||
#define TCP_INFO 11 /* Information about this connection. */
|
||||
#define TCP_QUICKACK 12 /* Bock/reenable quick ACKs. */
|
||||
#define TCP_QUICKACK 12 /* Bock/re-enable quick ACKs. */
|
||||
#define TCP_CONGESTION 13 /* Congestion control algorithm. */
|
||||
#define TCP_MD5SIG 14 /* TCP MD5 Signature (RFC2385) */
|
||||
#define TCP_COOKIE_TRANSACTIONS 15 /* TCP Cookie Transactions */
|
||||
|
||||
@ -282,7 +282,7 @@ os_thread_join(korp_tid thread, void **value_ptr)
|
||||
mutex_unlock(&thread_data->wait_list_lock);
|
||||
|
||||
sema_wait(&node.sem);
|
||||
// get the return value pointer conted may not be availible after return
|
||||
// get the return value pointer conted may not be available after return
|
||||
if (value_ptr)
|
||||
(*value_ptr) = node.ret;
|
||||
/* Wait some time for the thread to be actually terminated */
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
#if BH_DEBUG != 0
|
||||
/**
|
||||
* Test whehter a pointer value has exist in given list.
|
||||
* Test whether a pointer value has exist in given list.
|
||||
*
|
||||
* @param list pointer to list.
|
||||
* @param elem pointer to elem that will be inserted into list.
|
||||
|
||||
Reference in New Issue
Block a user