Add commands shell_acpi_{set,get}_usage, update test logs.

This commit is contained in:
Ivan Baravy 2020-05-20 14:03:22 +03:00
parent d995632e71
commit b22d2aacf3
8 changed files with 719 additions and 30353 deletions

1
.gitignore vendored
View File

@ -25,3 +25,4 @@ coverage.*
covpreproc
*.skn
*.dsl
*.aml

29
shell.c
View File

@ -1070,6 +1070,10 @@ void shell_read80(int argc, char **argv) {
void shell_acpi_preload_table(int argc, char **argv) {
(void)argc;
FILE *f = fopen(argv[1], "r");
if (!f) {
fprintf(fout, "[umka] can't open file: %s\n", argv[1]);
return;
}
fseek(f, 0, SEEK_END);
size_t fsize = ftell(f);
rewind(f);
@ -1090,6 +1094,29 @@ void shell_acpi_enable(int argc, char **argv) {
COVERAGE_OFF();
}
void shell_acpi_set_usage(int argc, char **argv) {
const char *usage = \
"usage: acpi_set_usage <num>\n"
" num one of ACPI_USAGE_*";
if (argc != 2) {
puts(usage);
return;
}
uint32_t acpi_usage = strtoul(argv[1], NULL, 0);
kos_acpi_usage = acpi_usage;
}
void shell_acpi_get_usage(int argc, char **argv) {
(void)argv;
const char *usage = \
"usage: acpi_get_usage";
if (argc != 1) {
puts(usage);
return;
}
fprintf(fout, "ACPI usage: %" PRIu32 "\n", kos_acpi_usage);
}
void shell_stack_init(int argc, char **argv) {
(void)argc;
(void)argv;
@ -1838,6 +1865,8 @@ func_table_t funcs[] = {
{ "scrot", shell_scrot },
{ "dump_win_stack", shell_dump_win_stack },
{ "dump_win_pos", shell_dump_win_pos },
{ "acpi_set_usage", shell_acpi_set_usage },
{ "acpi_get_usage", shell_acpi_get_usage },
{ "acpi_enable", shell_acpi_enable },
{ "acpi_preload_table", shell_acpi_preload_table },
{ "stack_init", shell_stack_init },

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -47,6 +47,7 @@ public enable_acpi
public acpi_ssdt_cnt as 'kos_acpi_ssdt_cnt'
public kos_acpi_ssdt_base
public kos_acpi_ssdt_size
public acpi_usage as 'kos_acpi_usage'
public stack_init
public net_add_device

1
umka.h
View File

@ -487,6 +487,7 @@ extern uint16_t *kos_win_pos;
extern uint32_t kos_acpi_ssdt_cnt;
extern uint8_t **kos_acpi_ssdt_base;
extern size_t *kos_acpi_ssdt_size;
extern uint32_t kos_acpi_usage;
extern disk_t disk_list;
static inline void umka_i40(pushad_t *regs) {