Files
acrn-hypervisor/hypervisor/debug/riscv/riscv_shell.c
Fei Li 712568f949 shell: split arch special code
Now moved all the guest related (risc-v doesn't support VMs) and x86 specific
commands to x86_shell.c except shell_dump_host_mem.

common for guest.
> -static int32_t shell_list_vm(__unused int32_t argc, __unused char **argv);
> -static int32_t shell_list_vcpu(__unused int32_t argc, __unused char **argv);
> -static int32_t shell_to_vm_console(int32_t argc, char **argv);
  depends on how we map guest memory.
> -static int32_t shell_dump_guest_mem(int32_t argc, char **argv);

common concept but arch special implementation.
> -static int32_t shell_vcpu_dumpreg(int32_t argc, char **argv);
> -static int32_t shell_show_cpu_int(__unused int32_t argc, __unused char **argv);
> -static int32_t shell_show_ptdev_info(__unused int32_t argc, __unused char **argv);
> -static int32_t shell_reboot(int32_t argc, char **argv);

x86 special
> -static int32_t shell_show_vioapic_info(int32_t argc, char **argv);
> -static int32_t shell_show_ioapic_info(__unused int32_t argc, __unused char **argv);
> -static int32_t shell_cpuid(int32_t argc, char **argv);
> -static int32_t shell_rdmsr(int32_t argc, char **argv);
> -static int32_t shell_wrmsr(int32_t argc, char **argv);

common but not added for now.
> -static int32_t shell_dump_host_mem(int32_t argc, char **argv);

Tracked-On: #8805
Signed-off-by: Fei Li <fei1.li@intel.com>
2025-10-14 14:45:12 +08:00

42 lines
930 B
C

/*
* Copyright (C) 2018-2025 Intel Corporation.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <types.h>
#include <errno.h>
#include <bits.h>
#include <console.h>
#include <sprintf.h>
#include <logmsg.h>
#include <version.h>
#include <cpu.h>
#include "debug/shell_priv.h"
#define SHELL_RISCV_DEMO_SHELL "riscv_demo_shell"
#define SHELL_RISCV_DEMO_SHELL_PARAM NULL
#define SHELL_RISCV_DEMO_SHELL_HELP "RISC-V shell demo"
static int32_t shell_riscv_demo_shell(__unused int32_t argc, __unused char **argv);
struct shell_cmd arch_shell_cmds[] = {
{
.str = SHELL_RISCV_DEMO_SHELL,
.cmd_param = SHELL_RISCV_DEMO_SHELL_PARAM,
.help_str = SHELL_RISCV_DEMO_SHELL_HELP,
.fcn = shell_riscv_demo_shell,
},
};
uint32_t arch_shell_cmds_sz = ARRAY_SIZE(arch_shell_cmds);
static int32_t shell_riscv_demo_shell(__unused int32_t argc, __unused char **argv)
{
shell_puts("\r\n RISC-V SHELL DEMO\r\n");
return 0;
}