Commit 93de3cde authored by Kunshan Wang's avatar Kunshan Wang

reorder MuVM methods to put proprietary methods last

parent 58cf0076
......@@ -291,14 +291,14 @@ struct MuVM {
// Set handlers
void (*set_trap_handler)(MuVM *mvm, MuTrapHandler trap_handler, MuCPtr userdata);
// Proprietary API of refimpl2: Let the micro VM execute.
void (*execute)(MuVM *mvm);
// Build boot image
void (*make_boot_image)(MuVM *mvm,
MuID* whitelist, MuArraySize whitelist_sz,
MuCString output_file); /// MUAPIPARSER whitelist:array:whitelist_sz
// Proprietary API of refimpl2: Let the micro VM execute.
void (*execute)(MuVM *mvm);
// Proprietary API of refimpl2: Get the pointer to the internal error
// number allocate in the micro VM. It is set to non-zero whenever an
// exception is thrown when the client calls through this C API. This gives
......
......@@ -1230,8 +1230,8 @@ _initialize_methods(MuVM, [
('id_of', CMuID, [CMuName]),
('name_of', CMuName, [CMuID]),
('set_trap_handler_', None, [CMuTrapHandler, CMuCPtr]),
('execute', None, []),
('make_boot_image', None, [ctypes.c_void_p, CMuArraySize, CMuCString]),
('execute', None, []),
('get_mu_error_ptr', ctypes.c_void_p, []),
## GEN:END:MuVM
])
......
......@@ -51,11 +51,6 @@ val trap_handler = _raw_trap_handler
val userdata = _raw_userdata
val _RV = mvm.setTrapHandler(trap_handler, userdata)
}
val MUVM__EXECUTE = exposedMethod("MuVM.execute", JType.VOID, Array(JType.POINTER)) { _jffiBuffer =>
val _raw_mvm = _jffiBuffer.getAddress(0)
val mvm = getMicroVM(_raw_mvm)
val _RV = mvm.execute()
}
val MUVM__MAKE_BOOT_IMAGE = exposedMethod("MuVM.make_boot_image", JType.VOID, Array(JType.POINTER, JType.POINTER, JType.POINTER, JType.POINTER)) { _jffiBuffer =>
val _raw_mvm = _jffiBuffer.getAddress(0)
val _raw_whitelist = _jffiBuffer.getAddress(1)
......@@ -66,6 +61,11 @@ val whitelist = readIntArray(_raw_whitelist, _raw_whitelist_sz)
val output_file = readCString(_raw_output_file)
val _RV = mvm.makeBootImage(whitelist, output_file)
}
val MUVM__EXECUTE = exposedMethod("MuVM.execute", JType.VOID, Array(JType.POINTER)) { _jffiBuffer =>
val _raw_mvm = _jffiBuffer.getAddress(0)
val mvm = getMicroVM(_raw_mvm)
val _RV = mvm.execute()
}
val MUVM__GET_MU_ERROR_PTR = exposedMethod("MuVM.get_mu_error_ptr", JType.POINTER, Array(JType.POINTER)) { _jffiBuffer =>
val _raw_mvm = _jffiBuffer.getAddress(0)
val mvm = getMicroVM(_raw_mvm)
......@@ -77,8 +77,8 @@ stubsOfMuVM(0) = MUVM__NEW_CONTEXT.address
stubsOfMuVM(1) = MUVM__ID_OF.address
stubsOfMuVM(2) = MUVM__NAME_OF.address
stubsOfMuVM(3) = MUVM__SET_TRAP_HANDLER.address
stubsOfMuVM(4) = MUVM__EXECUTE.address
stubsOfMuVM(5) = MUVM__MAKE_BOOT_IMAGE.address
stubsOfMuVM(4) = MUVM__MAKE_BOOT_IMAGE.address
stubsOfMuVM(5) = MUVM__EXECUTE.address
stubsOfMuVM(6) = MUVM__GET_MU_ERROR_PTR.address
val MUCTX__ID_OF = exposedMethod("MuCtx.id_of", JType.UINT32, Array(JType.POINTER, JType.POINTER)) { _jffiBuffer =>
val _raw_ctx = _jffiBuffer.getAddress(0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment