Skip to content
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

create a variable for the ext data array size #352

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/sbi/sbi_hart.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ struct sbi_hart_ext_data {
};

extern const struct sbi_hart_ext_data sbi_hart_ext[];
extern const int sbi_hart_ext_size;

/*
* Smepmp enforces access boundaries between M-mode and
Expand Down
2 changes: 2 additions & 0 deletions lib/sbi/sbi_hart.c
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,8 @@ const struct sbi_hart_ext_data sbi_hart_ext[] = {
__SBI_HART_EXT_DATA(smcdeleg, SBI_HART_EXT_SMCDELEG),
};

const int sbi_hart_ext_size = sizeof(sbi_hart_ext) / sizeof(sbi_hart_ext[0]);

/**
* Get the hart extensions in string format
*
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/fdt/fdt_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ static int fdt_parse_isa_one_hart(const char *isa, unsigned long *extensions)
continue; \
}

for (j = 0; j < SBI_HART_EXT_MAX; j++) {
for (j = 0; j < sbi_hart_ext_size; j++) {
rminnich marked this conversation as resolved.
Show resolved Hide resolved
set_multi_letter_ext(sbi_hart_ext[j].name,
sbi_hart_ext[j].id);
}
Expand Down