Skip to content

Commit

Permalink
ref(core/remio): reflect namespace changes
Browse files Browse the repository at this point in the history
Signed-off-by: João Peixoto <[email protected]>
  • Loading branch information
joaopeixoto13 committed Sep 20, 2024
1 parent 103f699 commit 00b5acd
Show file tree
Hide file tree
Showing 8 changed files with 207 additions and 210 deletions.
4 changes: 2 additions & 2 deletions src/core/hypercall.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ long int hypercall(unsigned long id)
case HC_IPC:
ret = ipc_hypercall(arg0, arg1, arg2);
break;
case HC_REMOTE_IO:
ret = remote_io_hypercall(arg0, arg1, arg2);
case HC_REMIO:
ret = remio_hypercall(arg0, arg1, arg2);
break;
default:
WARNING("Unknown hypercall id %d", id);
Expand Down
2 changes: 1 addition & 1 deletion src/core/inc/hypercall.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <bao.h>
#include <arch/hypercall.h>

enum { HC_INVAL = 0, HC_IPC = 1, HC_REMOTE_IO = 2 };
enum { HC_INVAL = 0, HC_IPC = 1, HC_REMIO = 2 };

enum { HC_E_SUCCESS = 0, HC_E_FAILURE = 1, HC_E_INVAL_ID = 2, HC_E_INVAL_ARGS = 3 };

Expand Down
36 changes: 18 additions & 18 deletions src/core/inc/remio.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,43 +18,43 @@
#include <vm.h>

/**
* @struct remote_io_shmem
* @struct remio_shmem
* @brief This structure represents a shared memory region used by a Remote I/O device
*/
struct remote_io_shmem {
struct remio_shmem {
paddr_t base; /**< Shared memory base address */
size_t size; /**< Shared memory size */
size_t shmem_id; /**< Shared memory ID */
};

/**
* @enum REMOTE_IO_DEV_TYPE
* @enum REMIO_DEV_TYPE
* @brief This enum represents the Remote I/O device type
*/
enum REMOTE_IO_DEV_TYPE {
REMOTE_IO_DEV_FRONTEND = 0, /**< Remote I/O frontend device */
REMOTE_IO_DEV_BACKEND /**< Remote I/O backend device */
enum REMIO_DEV_TYPE {
REMIO_DEV_FRONTEND = 0, /**< Remote I/O frontend device */
REMIO_DEV_BACKEND /**< Remote I/O backend device */
};

/**
* @struct remote_io_dev
* @struct remio_dev
* @brief This structure represents a Remote I/O device
* @note The device can be either a frontend (driver) or a backend (device)
*/
struct remote_io_dev {
vaddr_t va; /**< Frontend MMIO base virtual address */
size_t size; /**< Frontend MMIO size */
irqid_t interrupt; /**< Frontend/backend interrupt number */
remote_io_id_t id; /**< Remote I/O ID */
enum REMOTE_IO_DEV_TYPE type; /**< Type of the Remote I/O device */
struct remote_io_shmem shmem; /**< Shared memory region */
struct remio_dev {
vaddr_t va; /**< Frontend MMIO base virtual address */
size_t size; /**< Frontend MMIO size */
irqid_t interrupt; /**< Frontend/backend interrupt number */
remio_id_t id; /**< Remote I/O ID */
enum REMIO_DEV_TYPE type; /**< Type of the Remote I/O device */
struct remio_shmem shmem; /**< Shared memory region */
};

/**
* @brief Remote I/O device initialization routine
* @note Executed only once by the master CPU
*/
void remote_io_init(void);
void remio_init(void);

/**
* @brief Remote I/O device VM CPU assignment routine
Expand All @@ -64,7 +64,7 @@ void remote_io_init(void);
* one with the lowest ID, since only one CPU is required to inject VM interrupts
* @param vm Pointer to the VM structure
*/
void remote_io_assign_vm_cpus(struct vm* vm);
void remio_assign_vm_cpus(struct vm* vm);

/**
* @brief Remote I/O hypercall callback
Expand All @@ -74,14 +74,14 @@ void remote_io_assign_vm_cpus(struct vm* vm);
* @param arg2 Third argument of the hypercall
* @return Returns the number of pending I/O requests
*/
long int remote_io_hypercall(unsigned long arg0, unsigned long arg1, unsigned long arg2);
long int remio_hypercall(unsigned long arg0, unsigned long arg1, unsigned long arg2);

/**
* @brief Remote I/O MMIO emulation handler
* @note Executed by the frontend VM when a MMIO access is performed
* @param emul_access Holds the information about the MMIO access
* @return Returns true if handled successfully, false otherwise
*/
bool remote_io_mmio_emul_handler(struct emul_access* emul_access);
bool remio_mmio_emul_handler(struct emul_access* emul_access);

#endif /* __REMIO_H__ */
2 changes: 1 addition & 1 deletion src/core/inc/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ typedef unsigned irqid_t;

typedef unsigned deviceid_t;

typedef size_t remote_io_id_t;
typedef size_t remio_id_t;

typedef enum AS_SEC {
/*--- HYP AS SECTIONS -----*/
Expand Down
8 changes: 4 additions & 4 deletions src/core/inc/vm.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ struct vm_platform {
size_t dev_num;
struct vm_dev_region* devs;

size_t remote_io_dev_num;
struct remote_io_dev* remote_io_devs;
size_t remio_dev_num;
struct remio_dev* remio_devs;

// /**
// * In MPU-based platforms which might also support virtual memory
Expand Down Expand Up @@ -89,8 +89,8 @@ struct vm {
size_t ipc_num;
struct ipc* ipcs;

size_t remote_io_dev_num;
struct remote_io_dev* remote_io_devs;
size_t remio_dev_num;
struct remio_dev* remio_devs;
};

struct vcpu {
Expand Down
Loading

0 comments on commit 00b5acd

Please sign in to comment.