-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor C API #273
Open
edubart
wants to merge
57
commits into
main
Choose a base branch
from
refactor/c-api
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Refactor C API #273
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
edubart
added
the
refactor
Restructuring code, while not changing its original functionality
label
Sep 8, 2024
5 tasks
edubart
force-pushed
the
refactor/c-api
branch
2 times, most recently
from
September 9, 2024 15:08
2f91fae
to
4731564
Compare
- removed cm_reset_iflags_X - removed cm_set_iflags_H - removed cm_set_iflags_X
edubart
force-pushed
the
refactor/c-api
branch
3 times, most recently
from
September 10, 2024 21:02
24bfd1e
to
5fcce41
Compare
edubart
force-pushed
the
refactor/c-api
branch
9 times, most recently
from
September 21, 2024 11:13
ec9390a
to
0dc2566
Compare
edubart
force-pushed
the
refactor/c-api
branch
3 times, most recently
from
September 29, 2024 15:13
e33bc44
to
c684735
Compare
edubart
force-pushed
the
refactor/c-api
branch
from
September 29, 2024 21:28
c684735
to
5eeedac
Compare
edubart
force-pushed
the
refactor/c-api
branch
from
October 1, 2024 17:56
ded1357
to
2a06f6f
Compare
edubart
force-pushed
the
refactor/c-api
branch
from
October 8, 2024 15:31
af36b9b
to
e66a9fa
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the actual implementation of the new C API overhaul. This is mostly finished and ready for review.
Added:
--load-json-config
and--store-json-config
).tojson
/fromjson
/tobase64
/frombase64
functions.Changed:
*-defines.h
are not installed anymore (they are now considered implementation details which external people should not care about, try to depend on or bind).sanitize=yes
anddebug=yes
to improve backtrace and catch more bugs.stdout
instead ofstderr
.htif.tohost
/htif.fromhost
promotedreason
to be an official 2-bytes field, itsdata
field shrunk to 4 bytes.no4lvl
from bootargs, it's not needed anymore.Removed:
clua-htif.cpp
(its constants are exposed along with other Lua constants now).machine-c-defines.h
header (its constants are now gone or in the machine C API header).C API Added:
cm_get_last_error_message
, returning the error message for the most recent failed call.cm_constant
enumeration with new constants.cm_cmio_yield_command
and cm_cmio_yield_reason` enumeration with CMIO yields.cm_access_log_type
enumeration with bitwise flags for access log type.cm_pma_constant
enumeration.CM_REG_*
for all machine control registers.CM_MCYCLE_MAX
macro and set toUINT64_MAX
cm_receive_cmio_request
to make it easier to perform IO using CMIO protocol.C API Removed:
err_msg
arguments (the latest error message can be retrieved fromcm_get_last_error_message()
).one_based
arguments from log related functions (its error messages now use user ordinal numbers).cm_new_default_machine_config
cm_get_f_address
cm_get_x_address
cm_reset_iflags_X
/cm_set_iflags_H
/cm_set_iflags_X
cm_verify_*_log
.cm_read_*
/cm_write_*
of all registers, except formcycle
/uarch_cycle
/uarch_halt_flag
/iflags
.cm_delete_*
functions.CM_ERROR_*
enums.C API Renamed:
cm_read_csr
->cm_read_reg
cm_write_csr
->cm_write_reg
cm_get_csr_address
->cm_get_reg_address
cm_create_machine
->cm_create
cm_load_machine
->cm_load
cm_delete_machine
->cm_destroy
*_uarch_reset*
->*_reset_uarch*
*_uarch_step*
->*_step_uarch*
cm_verify_*_state_transition
->cm_verify_*
cm_machine_run
->cm_run
cm_machine_run_uarch
->cm_run_uarch
CM_PROC_CSR
->CM_REG
cm_create_jsonrpc_machine
->cm_jsonrpc_create_machine
cm_load_jsonrpc_machine
->cm_jsonrpc_load_machine
cm_get_jsonrpc_machine
->cm_jsonrpc_get_machine
cm_create_jsonrpc_mgr
->cm_jsonrpc_create_mgr
cm_delete_jsonrpc_mgr
->cm_jsonrpc_destroy_mgr
C API Changed:
cm_replace_memory_range
to take multiple arguments instead of a struct.cm_get_default_config
output to its return instead of parameter (because it should never fail in practice).cm_get_memory_ranges
to output a JSON string instead of a struct.