arch/sim: Unify the host soruce file naming

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-11-22 03:08:47 +08:00 committed by Petro Karashchenko
parent d3ffeb40a7
commit 79d02c0e29
20 changed files with 152 additions and 151 deletions

View File

@ -94,7 +94,7 @@ ifeq ($(CONFIG_HOST_MACOS),y)
HOSTCFLAGS += -Wno-deprecated-declarations
endif
HOSTSRCS = sim_hostirq.c sim_hostmemory.c sim_hosttime.c sim_simuart.c sim_hostmisc.c
HOSTSRCS = sim_hostirq.c sim_hostmemory.c sim_hosttime.c sim_hostuart.c sim_hostmisc.c
STDLIBS += -lpthread
ifeq ($(CONFIG_HOST_MACOS),y)
ifeq ($(CONFIG_HAVE_CXXINITIALIZE),y)
@ -117,7 +117,7 @@ endif
ifeq ($(CONFIG_SMP),y)
CSRCS += sim_smpsignal.c sim_cpuidlestack.c
HOSTSRCS += sim_simsmp.c
HOSTSRCS += sim_hostsmp.c
endif
ifeq ($(CONFIG_ONESHOT),y)
@ -177,21 +177,21 @@ else ifeq ($(CONFIG_SIM_NETDEV_VPNKIT),y)
endif
ifeq ($(CONFIG_SIM_NETUSRSOCK),y)
HOSTSRCS += sim_usrsock_host.c
HOSTSRCS += sim_hostusrsock.c
CSRCS += sim_usrsock.c
endif
ifeq ($(CONFIG_SIM_HCISOCKET),y)
HOSTSRCS += sim_hcisocket_host.c
HOSTSRCS += sim_hosthcisocket.c
CSRCS += sim_hcisocket.c
endif
ifeq ($(CONFIG_SIM_I2CBUS_LINUX),y)
HOSTSRCS += sim_i2cbuslinux.c
HOSTSRCS += sim_linuxi2c.c
endif
ifeq ($(CONFIG_SIM_SPI_LINUX),y)
HOSTSRCS += sim_spilinux.c
HOSTSRCS += sim_linuxspi.c
endif
ifeq ($(CONFIG_RPTUN),y)

View File

@ -1,5 +1,5 @@
/****************************************************************************
* arch/sim/src/sim/posix/sim_hcisocket_host.c
* arch/sim/src/sim/posix/sim_hosthcisocket.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -34,7 +34,7 @@
#include <errno.h>
#include "sim_internal.h"
#include "sim_hcisocket_host.h"
#include "sim_hostusrsock.h"
/****************************************************************************
* Pre-processor Definitions
@ -63,7 +63,7 @@ struct sockaddr_hci
****************************************************************************/
/****************************************************************************
* Name: sim_bthcisock_hostavail
* Name: sim_host_bthcisock_avail
*
* Description:
* Monitor the host user channel to see if I/O is possible on socket.
@ -76,7 +76,7 @@ struct sockaddr_hci
*
****************************************************************************/
int sim_bthcisock_hostavail(int fd)
int sim_host_bthcisock_avail(int fd)
{
struct timeval tv;
fd_set fdset;
@ -100,7 +100,7 @@ int sim_bthcisock_hostavail(int fd)
}
/****************************************************************************
* Name: sim_bthcisock_hostsend
* Name: sim_host_bthcisock_send
*
* Description:
* Send a Bluetooth packet out via the host user socket.
@ -116,7 +116,7 @@ int sim_bthcisock_hostavail(int fd)
*
****************************************************************************/
int sim_bthcisock_hostsend(int fd, const void *data, size_t len)
int sim_host_bthcisock_send(int fd, const void *data, size_t len)
{
while (write(fd, data, len) < 0)
{
@ -132,7 +132,7 @@ int sim_bthcisock_hostsend(int fd, const void *data, size_t len)
}
/****************************************************************************
* Name: sim_bthcisock_hostread
* Name: sim_host_bthcisock_receive
*
* Description:
* Read from the Host HCI socket interface.
@ -148,7 +148,7 @@ int sim_bthcisock_hostsend(int fd, const void *data, size_t len)
*
****************************************************************************/
int sim_bthcisock_hostread(int fd, void *data, size_t len)
int sim_host_bthcisock_receive(int fd, void *data, size_t len)
{
int err;
@ -167,7 +167,7 @@ int sim_bthcisock_hostread(int fd, void *data, size_t len)
}
/****************************************************************************
* Name: sim_bthcisock_hostopen
* Name: sim_host_bthcisock_open
*
* Description:
* Open a User Channel HCI socket on the Host for the given device.
@ -183,7 +183,7 @@ int sim_bthcisock_hostread(int fd, void *data, size_t len)
*
****************************************************************************/
int sim_bthcisock_hostopen(int dev_idx)
int sim_host_bthcisock_open(int dev_idx)
{
int err;
struct sockaddr_hci addr;
@ -218,7 +218,7 @@ int sim_bthcisock_hostopen(int dev_idx)
}
/****************************************************************************
* Name: sim_bthcisock_hostclose
* Name: sim_host_bthcisock_close
*
* Description:
* Close a User Channel HCI socket on the Host for the given device idx.
@ -232,7 +232,7 @@ int sim_bthcisock_hostopen(int dev_idx)
*
****************************************************************************/
int sim_bthcisock_hostclose(int fd)
int sim_host_bthcisock_close(int fd)
{
return close(fd);
}

View File

@ -1,5 +1,5 @@
/****************************************************************************
* arch/sim/src/sim/posix/sim_simsmp.c
* arch/sim/src/sim/posix/sim_hostsmp.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -99,11 +99,12 @@ static void *sim_idle_trampoline(void *arg)
pthread_mutex_unlock(&cpuinfo->cpu_init_lock);
/* sim_cpu_started() is logically a part of this function but needs to be
* inserted in the path because in needs to access NuttX domain definition.
/* sim_host_cpu_started() is logically a part of this function but
* needs to be inserted in the path because in needs to access NuttX
* domain definition.
*/
sim_cpu_started();
sim_host_cpu_started();
/* The idle Loop */
@ -123,7 +124,7 @@ static void *sim_idle_trampoline(void *arg)
****************************************************************************/
/****************************************************************************
* Name: sim_cpu0_start
* Name: sim_host_cpu0_start
*
* Description:
* Create the pthread-specific data key and set the indication of CPU0
@ -137,7 +138,7 @@ static void *sim_idle_trampoline(void *arg)
*
****************************************************************************/
void sim_cpu0_start(void)
void sim_host_cpu0_start(void)
{
int ret;
@ -209,7 +210,7 @@ int up_cpu_index(void)
*
****************************************************************************/
int sim_cpu_start(int cpu, void *stack, size_t size)
int sim_host_cpu_start(int cpu, void *stack, size_t size)
{
struct sim_cpuinfo_s cpuinfo;
pthread_attr_t attr;
@ -255,10 +256,10 @@ errout_with_cond:
}
/****************************************************************************
* Name: sim_send_ipi(int cpu)
* Name: sim_host_send_ipi(int cpu)
****************************************************************************/
void sim_send_ipi(int cpu)
void sim_host_send_ipi(int cpu)
{
pthread_kill(g_cpu_thread[cpu], SIGUSR1);
}

View File

@ -1,5 +1,5 @@
/****************************************************************************
* arch/sim/src/sim/posix/sim_simuart.c
* arch/sim/src/sim/posix/sim_hostuart.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -80,10 +80,10 @@ static void restoremode(void)
****************************************************************************/
/****************************************************************************
* Name: simuart_start
* Name: host_uart_start
****************************************************************************/
void simuart_start(void)
void host_uart_start(void)
{
/* Get the current stdin terminal mode */
@ -99,10 +99,10 @@ void simuart_start(void)
}
/****************************************************************************
* Name: simuart_open
* Name: host_uart_open
****************************************************************************/
int simuart_open(const char *pathname)
int host_uart_open(const char *pathname)
{
int fd;
@ -122,28 +122,28 @@ int simuart_open(const char *pathname)
}
/****************************************************************************
* Name: simuart_close
* Name: host_uart_close
****************************************************************************/
void simuart_close(int fd)
void host_uart_close(int fd)
{
close(fd);
}
/****************************************************************************
* Name: simuart_putc
* Name: host_uart_putc
****************************************************************************/
int simuart_putc(int fd, int ch)
int host_uart_putc(int fd, int ch)
{
return write(fd, &ch, 1) == 1 ? ch : -1;
}
/****************************************************************************
* Name: simuart_getc
* Name: host_uart_getc
****************************************************************************/
int simuart_getc(int fd)
int host_uart_getc(int fd)
{
int ret;
unsigned char ch;
@ -153,10 +153,10 @@ int simuart_getc(int fd)
}
/****************************************************************************
* Name: simuart_getcflag
* Name: host_uart_getcflag
****************************************************************************/
int simuart_getcflag(int fd, unsigned int *cflag)
int host_uart_getcflag(int fd, unsigned int *cflag)
{
struct termios t;
int ret;
@ -175,10 +175,10 @@ int simuart_getcflag(int fd, unsigned int *cflag)
}
/****************************************************************************
* Name: simuart_setcflag
* Name: host_uart_setcflag
****************************************************************************/
int simuart_setcflag(int fd, unsigned int cflag)
int host_uart_setcflag(int fd, unsigned int cflag)
{
struct termios t;
int ret;
@ -199,10 +199,10 @@ int simuart_setcflag(int fd, unsigned int cflag)
}
/****************************************************************************
* Name: simuart_checkc
* Name: host_uart_checkc
****************************************************************************/
bool simuart_checkc(int fd)
bool host_uart_checkc(int fd)
{
struct pollfd pfd;

View File

@ -1,5 +1,5 @@
/****************************************************************************
* arch/sim/src/sim/posix/sim_usrsock_host.c
* arch/sim/src/sim/posix/sim_hostusrsock.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -37,7 +37,7 @@
#include <netinet/in.h>
#include "sim_usrsock_host.h"
#include "sim_hostusrsock.h"
/****************************************************************************
* Pre-processor Definitions

View File

@ -1,5 +1,5 @@
/****************************************************************************
* arch/sim/src/sim/posix/sim_i2cbus.h
* arch/sim/src/sim/posix/sim_i2c.h
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -18,8 +18,8 @@
*
****************************************************************************/
#ifndef __ARCH_SIM_SRC_SIM_I2CBUS_H
#define __ARCH_SIM_SRC_SIM_I2CBUS_H
#ifndef __ARCH_SIM_SRC_POSIX_SIM_I2C_H
#define __ARCH_SIM_SRC_POSIX_SIM_I2C_H
/****************************************************************************
* Included Files
@ -77,4 +77,4 @@ struct i2c_ops_s
* Public Function Prototypes
****************************************************************************/
#endif /* __ARCH_SIM_SRC_SIM_I2CBUS_H */
#endif /* __ARCH_SIM_SRC_POSIX_SIM_I2C_H */

View File

@ -1,5 +1,5 @@
/****************************************************************************
* arch/sim/src/sim/posix/sim_i2cbuslinux.c
* arch/sim/src/sim/posix/sim_linuxi2c.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -36,7 +36,7 @@
#include <linux/i2c-dev.h>
#include <linux/i2c.h>
#include "sim_i2cbus.h"
#include "sim_i2c.h"
/****************************************************************************
* Pre-processor Definitions

View File

@ -1,5 +1,5 @@
/****************************************************************************
* arch/sim/src/sim/posix/sim_spilinux.c
* arch/sim/src/sim/posix/sim_linuxspi.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with

View File

@ -18,8 +18,8 @@
*
****************************************************************************/
#ifndef __ARCH_SIM_SRC_SIM_SPI_H
#define __ARCH_SIM_SRC_SIM_SPI_H
#ifndef __ARCH_SIM_SRC_POSIX_SIM_SPI_H
#define __ARCH_SIM_SRC_POSIX_SIM_SPI_H
/****************************************************************************
* Included Files
@ -153,4 +153,4 @@ struct spi_sequence_s
* Public Function Prototypes
****************************************************************************/
#endif /* __ARCH_SIM_SRC_SIM_SPI_H */
#endif /* __ARCH_SIM_SRC_POSIX_SIM_SPI_H */

View File

@ -44,7 +44,7 @@
#include <nuttx/serial/uart_bth4.h>
#include "sim_internal.h"
#include "sim_hcisocket_host.h"
#include "sim_hosthcisocket.h"
/****************************************************************************
* Pre-processor Definitions
@ -110,7 +110,7 @@ static int bthcisock_send(struct bt_driver_s *drv,
return -EINVAL;
}
ret = sim_bthcisock_hostsend(dev->fd, hdr, len + H4_HEADER_SIZE);
ret = sim_host_bthcisock_send(dev->fd, hdr, len + H4_HEADER_SIZE);
return ret < 0 ? ret : len;
}
@ -119,7 +119,7 @@ static void bthcisock_close(struct bt_driver_s *drv)
{
struct bthcisock_s *dev = (struct bthcisock_s *)drv;
sim_bthcisock_hostclose(dev->fd);
sim_host_bthcisock_close(dev->fd);
dev->fd = -1;
}
@ -130,7 +130,7 @@ static int bthcisock_receive(struct bt_driver_s *drv)
enum bt_buf_type_e type;
int ret;
ret = sim_bthcisock_hostread(dev->fd, data, sizeof(data));
ret = sim_host_bthcisock_receive(dev->fd, data, sizeof(data));
if (ret <= 0)
{
return ret;
@ -163,7 +163,7 @@ static int bthcisock_open(struct bt_driver_s *drv)
struct bthcisock_s *dev = (struct bthcisock_s *)drv;
int fd;
fd = sim_bthcisock_hostopen(dev->id);
fd = sim_host_bthcisock_open(dev->id);
if (fd < 0)
{
@ -317,7 +317,7 @@ int sim_bthcisock_loop(void)
for (entry = sq_peek(&g_bthcisock_list); entry; entry = sq_next(entry))
{
dev = container_of(entry, struct bthcisock_s, link);
if (sim_bthcisock_hostavail(dev->fd))
if (sim_host_bthcisock_avail(dev->fd))
{
bthcisock_receive(&dev->drv);
}

View File

@ -123,7 +123,7 @@ int main(int argc, char **argv, char **envp)
#ifdef CONFIG_SMP
/* Start the CPU0 emulation. This should not return. */
sim_cpu0_start();
sim_host_cpu0_start();
#endif
/* Start the NuttX emulation. This should not return. */

View File

@ -1,5 +1,5 @@
/****************************************************************************
* arch/sim/src/sim/sim_hcisocket_host.h
* arch/sim/src/sim/sim_hosthcisocket.h
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -18,8 +18,8 @@
*
****************************************************************************/
#ifndef __ARCH_SIM_SRC_SIM_HCISOCKET_HOST_H
#define __ARCH_SIM_SRC_SIM_HCISOCKET_HOST_H
#ifndef __ARCH_SIM_SRC_SIM_HOSTHCISOCKET_H
#define __ARCH_SIM_SRC_SIM_HOSTHCISOCKET_H
/****************************************************************************
* Included Files
@ -32,10 +32,10 @@
* Public Function Prototypes
****************************************************************************/
int sim_bthcisock_hostopen(int dev_idx);
int sim_bthcisock_hostsend(int fd, const void *data, size_t len);
int sim_bthcisock_hostread(int fd, void *data, size_t len);
int sim_bthcisock_hostavail(int fd);
int sim_bthcisock_hostclose(int fd);
int sim_host_bthcisock_open(int dev_idx);
int sim_host_bthcisock_send(int fd, const void *data, size_t len);
int sim_host_bthcisock_receive(int fd, void *data, size_t len);
int sim_host_bthcisock_avail(int fd);
int sim_host_bthcisock_close(int fd);
#endif /* __ARCH_SIM_SRC_SIM_HCISOCKET_HOST_H */
#endif /* __ARCH_SIM_SRC_SIM_HOSTHCISOCKET_H */

View File

@ -1,5 +1,5 @@
/****************************************************************************
* arch/sim/src/sim/sim_usrsock_host.h
* arch/sim/src/sim/sim_hostusrsock.h
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -18,8 +18,8 @@
*
****************************************************************************/
#ifndef __ARCH_SIM_SRC_SIM_USRSOCK_HOST_H
#define __ARCH_SIM_SRC_SIM_USRSOCK_HOST_H
#ifndef __ARCH_SIM_SRC_SIM_HOSTUSRSOCK_H
#define __ARCH_SIM_SRC_SIM_HOSTUSRSOCK_H
/****************************************************************************
* Included Files
@ -314,4 +314,4 @@ int usrsock_host_ioctl(int fd, unsigned long request, ...);
void usrsock_host_loop(void);
#endif /* __SIM__ */
#endif /* __ARCH_SIM_SRC_SIM_USRSOCK_HOST_H */
#endif /* __ARCH_SIM_SRC_SIM_HOSTUSRSOCK_H */

View File

@ -34,7 +34,7 @@
#include <stdlib.h>
#include "sim_internal.h"
#include "sim_usrsock_host.h"
#include "sim_hostusrsock.h"
/****************************************************************************
* Private Functions

View File

@ -147,12 +147,12 @@ extern char **g_argv;
void sim_copyfullstate(unsigned long *dest, unsigned long *src);
void *sim_doirq(int irq, void *regs);
/* up_hostmisc.c ************************************************************/
/* sim_hostmisc.c ***********************************************************/
void sim_host_abort(int status);
int sim_host_backtrace(void** array, int size);
/* up_hostmemory.c **********************************************************/
/* sim_hostmemory.c *********************************************************/
void *sim_host_allocheap(size_t sz);
void *sim_host_allocshmem(const char *name, size_t size, int master);
@ -164,60 +164,60 @@ void sim_host_free(void *mem);
void *sim_host_realloc(void *oldmem, size_t size);
void sim_host_mallinfo(int *aordblks, int *uordblks);
/* up_hosttime.c ************************************************************/
/* sim_hosttime.c ***********************************************************/
uint64_t sim_host_gettime(bool rtc);
void sim_host_sleep(uint64_t nsec);
void sim_host_sleepuntil(uint64_t nsec);
int sim_host_settimer(int *irq);
/* up_sigdeliver.c **********************************************************/
/* sim_sigdeliver.c *********************************************************/
void sim_sigdeliver(void);
/* up_simsmp.c **************************************************************/
/* sim_hostsmp.c ************************************************************/
#ifdef CONFIG_SMP
void sim_cpu0_start(void);
int sim_cpu_start(int cpu, void *stack, size_t size);
void sim_send_ipi(int cpu);
void sim_host_cpu0_start(void);
int sim_host_cpu_start(int cpu, void *stack, size_t size);
void sim_host_send_ipi(int cpu);
#endif
/* up_smpsignal.c ***********************************************************/
/* sim_smpsignal.c **********************************************************/
#ifdef CONFIG_SMP
void sim_cpu_started(void);
void sim_host_cpu_started(void);
int sim_init_ipi(int irq);
#endif
/* up_oneshot.c *************************************************************/
/* sim_oneshot.c ************************************************************/
#ifdef CONFIG_ONESHOT
void sim_timer_update(void);
#endif
/* up_uart.c ****************************************************************/
/* sim_uart.c ***************************************************************/
void sim_uartinit(void);
void sim_uartloop(void);
/* up_simuart.c *************************************************************/
/* sim_hostuart.c ***********************************************************/
void simuart_start(void);
int simuart_open(const char *pathname);
void simuart_close(int fd);
int simuart_putc(int fd, int ch);
int simuart_getc(int fd);
bool simuart_checkc(int fd);
int simuart_setcflag(int fd, unsigned int cflag);
int simuart_getcflag(int fd, unsigned int *cflag);
void host_uart_start(void);
int host_uart_open(const char *pathname);
void host_uart_close(int fd);
int host_uart_putc(int fd, int ch);
int host_uart_getc(int fd);
bool host_uart_checkc(int fd);
int host_uart_setcflag(int fd, unsigned int cflag);
int host_uart_getcflag(int fd, unsigned int *cflag);
/* sim_deviceimage.c ********************************************************/
char *sim_deviceimage(void);
void sim_registerblockdevice(void);
/* up_x11framebuffer.c ******************************************************/
/* sim_x11framebuffer.c *****************************************************/
#ifdef CONFIG_SIM_X11FB
int sim_x11initialize(unsigned short width, unsigned short height,
@ -231,21 +231,21 @@ int sim_x11cmap(unsigned short first, unsigned short len,
#endif
#endif
/* up_touchscreen.c *********************************************************/
/* sim_touchscreen.c ********************************************************/
#ifdef CONFIG_SIM_TOUCHSCREEN
int sim_tsc_initialize(int minor);
int sim_tsc_uninitialize(void);
#endif
/* up_keyboard.c ************************************************************/
/* sim_keyboard.c ***********************************************************/
#ifdef CONFIG_SIM_KEYBOARD
int sim_kbd_initialize(void);
void sim_kbdevent(uint32_t key, bool is_press);
#endif
/* up_eventloop.c ***********************************************************/
/* sim_eventloop.c **********************************************************/
#if defined(CONFIG_SIM_TOUCHSCREEN) || defined(CONFIG_SIM_AJOYSTICK) || \
defined(CONFIG_ARCH_BUTTONS) || defined(CONFING_SIM_KEYBOARD)
@ -253,13 +253,13 @@ void sim_x11events(void);
void sim_buttonevent(int x, int y, int buttons);
#endif
/* up_ajoystick.c ***********************************************************/
/* sim_ajoystick.c **********************************************************/
#ifdef CONFIG_SIM_AJOYSTICK
int sim_ajoy_initialize(void);
#endif
/* up_tapdev.c **************************************************************/
/* sim_tapdev.c *************************************************************/
#if defined(CONFIG_SIM_NETDEV_TAP) && !defined(__CYGWIN__)
void sim_tapdev_init(int devidx, void *priv,
@ -280,7 +280,7 @@ void sim_tapdev_ifdown(int devidx);
# define sim_netdev_ifdown(idx) sim_tapdev_ifdown(idx)
#endif
/* up_wpcap.c ***************************************************************/
/* sim_wpcap.c **************************************************************/
#if defined(CONFIG_SIM_NETDEV_TAP) && defined(__CYGWIN__)
void sim_wpcap_init(void *priv,
@ -297,7 +297,7 @@ void sim_wpcap_send(unsigned char *buf, unsigned int buflen);
# define sim_netdev_ifdown(idx) {}
#endif
/* up_vpnkit.c **************************************************************/
/* sim_vpnkit.c *************************************************************/
#if defined(CONFIG_SIM_NETDEV_VPNKIT)
void sim_vpnkit_init(void *priv,
@ -315,42 +315,42 @@ void sim_vpnkit_send(unsigned char *buf, unsigned int buflen);
# define sim_netdev_ifdown(idx) {}
#endif
/* up_netdriver.c ***********************************************************/
/* sim_netdriver.c **********************************************************/
int sim_netdriver_init(void);
void sim_netdriver_setmacaddr(int devidx, unsigned char *macaddr);
void sim_netdriver_setmtu(int devidx, int mtu);
void sim_netdriver_loop(void);
/* up_rptun.c ***************************************************************/
/* sim_rptun.c **************************************************************/
#ifdef CONFIG_RPTUN
int sim_rptun_init(const char *shmemname, const char *cpuname, bool master);
void sim_rptun_loop(void);
#endif
/* up_hcisocket.c ***********************************************************/
/* sim_hcisocket.c **********************************************************/
#ifdef CONFIG_SIM_HCISOCKET
int sim_bthcisock_register(int dev_id);
int sim_bthcisock_loop(void);
#endif
/* up_audio.c ***************************************************************/
/* sim_audio.c **************************************************************/
#ifdef CONFIG_SIM_SOUND
struct audio_lowerhalf_s *sim_audio_initialize(bool playback);
void sim_audio_loop(void);
#endif
/* up_i2cbus*.c *************************************************************/
/* sim_*i2c.c ***************************************************************/
#ifdef CONFIG_SIM_I2CBUS
struct i2c_master_s *sim_i2cbus_initialize(int bus);
int sim_i2cbus_uninitialize(struct i2c_master_s *dev);
#endif
/* up_spi*.c ****************************************************************/
/* up_*spi.c ****************************************************************/
#ifdef CONFIG_SIM_SPI
struct spi_dev_s *sim_spi_initialize(const char *filename);

View File

@ -214,14 +214,14 @@ int up_cpu_paused(int cpu)
}
/****************************************************************************
* Name: sim_cpu_started
* Name: sim_host_cpu_started
*
* Description:
* Notify the current cpu start successfully.
*
****************************************************************************/
void sim_cpu_started(void)
void sim_host_cpu_started(void)
{
#ifdef CONFIG_SCHED_INSTRUMENTATION
struct tcb_s *tcb = this_task();
@ -273,7 +273,7 @@ int up_cpu_start(int cpu)
sched_note_cpu_start(this_task(), cpu);
#endif
return sim_cpu_start(cpu, tcb->stack_base_ptr, tcb->adj_stack_size);
return sim_host_cpu_start(cpu, tcb->stack_base_ptr, tcb->adj_stack_size);
}
/****************************************************************************
@ -339,7 +339,7 @@ int up_cpu_pause(int cpu)
/* Generate IRQ for CPU(cpu) */
sim_send_ipi(cpu);
sim_host_send_ipi(cpu);
/* Wait for the other CPU to unlock g_cpu_paused meaning that
* it is fully paused and ready for up_cpu_resume();

View File

@ -257,7 +257,7 @@ static int tty_setup(struct uart_dev_s *dev)
if (!dev->isconsole && priv->fd < 0)
{
priv->fd = simuart_open(priv->path);
priv->fd = host_uart_open(priv->path);
if (priv->fd < 0)
{
return priv->fd;
@ -284,7 +284,7 @@ static void tty_shutdown(struct uart_dev_s *dev)
{
/* close file Description and reset fd */
simuart_close(priv->fd);
host_uart_close(priv->fd);
priv->fd = -1;
}
}
@ -348,12 +348,12 @@ static int tty_ioctl(struct file *filep, int cmd, unsigned long arg)
switch (cmd)
{
case TCGETS:
return simuart_getcflag(dev->isconsole ? 0 : priv->fd,
&termiosp->c_cflag);
return host_uart_getcflag(dev->isconsole ? 0 : priv->fd,
&termiosp->c_cflag);
case TCSETS:
return simuart_setcflag(dev->isconsole ? 0 : priv->fd,
termiosp->c_cflag);
return host_uart_setcflag(dev->isconsole ? 0 : priv->fd,
termiosp->c_cflag);
}
#endif
@ -375,7 +375,7 @@ static int tty_receive(struct uart_dev_s *dev, uint32_t *status)
struct tty_priv_s *priv = dev->priv;
*status = 0;
return simuart_getc(dev->isconsole ? 0 : priv->fd);
return host_uart_getc(dev->isconsole ? 0 : priv->fd);
}
/****************************************************************************
@ -402,7 +402,7 @@ static bool tty_rxavailable(struct uart_dev_s *dev)
{
struct tty_priv_s *priv = dev->priv;
return simuart_checkc(dev->isconsole ? 0 : priv->fd);
return host_uart_checkc(dev->isconsole ? 0 : priv->fd);
}
/****************************************************************************
@ -443,10 +443,10 @@ static void tty_send(struct uart_dev_s *dev, int ch)
if (dev->isconsole && ch == '\n')
{
simuart_putc(1, '\r');
host_uart_putc(1, '\r');
}
simuart_putc(dev->isconsole ? 1 : priv->fd, ch);
host_uart_putc(dev->isconsole ? 1 : priv->fd, ch);
}
/****************************************************************************
@ -505,7 +505,7 @@ void sim_uartinit(void)
#ifdef USE_DEVCONSOLE
/* Start the simulated UART device */
simuart_start();
host_uart_start();
/* Register console device */
@ -536,35 +536,35 @@ void sim_uartinit(void)
void sim_uartloop(void)
{
#ifdef USE_DEVCONSOLE
if (simuart_checkc(0))
if (host_uart_checkc(0))
{
uart_recvchars(&g_console_dev);
}
#endif
#ifdef CONFIG_SIM_UART0_NAME
if (g_tty0_priv.fd > 0 && simuart_checkc(g_tty0_priv.fd))
if (g_tty0_priv.fd > 0 && host_uart_checkc(g_tty0_priv.fd))
{
uart_recvchars(&g_tty0_dev);
}
#endif
#ifdef CONFIG_SIM_UART1_NAME
if (g_tty1_priv.fd > 0 && simuart_checkc(g_tty1_priv.fd))
if (g_tty1_priv.fd > 0 && host_uart_checkc(g_tty1_priv.fd))
{
uart_recvchars(&g_tty1_dev);
}
#endif
#ifdef CONFIG_SIM_UART2_NAME
if (g_tty2_priv.fd > 0 && simuart_checkc(g_tty2_priv.fd))
if (g_tty2_priv.fd > 0 && host_uart_checkc(g_tty2_priv.fd))
{
uart_recvchars(&g_tty2_dev);
}
#endif
#ifdef CONFIG_SIM_UART3_NAME
if (g_tty3_priv.fd > 0 && simuart_checkc(g_tty3_priv.fd))
if (g_tty3_priv.fd > 0 && host_uart_checkc(g_tty3_priv.fd))
{
uart_recvchars(&g_tty3_dev);
}

View File

@ -30,7 +30,7 @@
#include <nuttx/net/usrsock.h>
#include "sim_usrsock_host.h"
#include "sim_hostusrsock.h"
/****************************************************************************
* Pre-processor Definitions

View File

@ -1,5 +1,5 @@
/****************************************************************************
* arch/sim/src/sim/win/sim_simuart.c
* arch/sim/src/sim/win/sim_hostuart.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -37,10 +37,10 @@ static HANDLE g_stdout_handle;
****************************************************************************/
/****************************************************************************
* Name: simuart_start
* Name: host_uart_start
****************************************************************************/
void simuart_start(void)
void host_uart_start(void)
{
DWORD mode;
@ -58,27 +58,27 @@ void simuart_start(void)
}
/****************************************************************************
* Name: simuart_open
* Name: host_uart_open
****************************************************************************/
int simuart_open(const char *pathname)
int host_uart_open(const char *pathname)
{
return -ENOSYS;
}
/****************************************************************************
* Name: simuart_close
* Name: host_uart_close
****************************************************************************/
void simuart_close(int fd)
void host_uart_close(int fd)
{
}
/****************************************************************************
* Name: simuart_putc
* Name: host_uart_putc
****************************************************************************/
int simuart_putc(int fd, int ch)
int host_uart_putc(int fd, int ch)
{
DWORD nwritten;
@ -91,10 +91,10 @@ int simuart_putc(int fd, int ch)
}
/****************************************************************************
* Name: simuart_getc
* Name: host_uart_getc
****************************************************************************/
int simuart_getc(int fd)
int host_uart_getc(int fd)
{
unsigned char ch;
DWORD nread;
@ -108,28 +108,28 @@ int simuart_getc(int fd)
}
/****************************************************************************
* Name: simuart_getcflag
* Name: host_uart_getcflag
****************************************************************************/
int simuart_getcflag(int fd, unsigned int *cflag)
int host_uart_getcflag(int fd, unsigned int *cflag)
{
return -ENOSYS;
}
/****************************************************************************
* Name: simuart_setcflag
* Name: host_uart_setcflag
****************************************************************************/
int simuart_setcflag(int fd, unsigned int cflag)
int host_uart_setcflag(int fd, unsigned int cflag)
{
return -ENOSYS;
}
/****************************************************************************
* Name: simuart_checkc
* Name: host_uart_checkc
****************************************************************************/
bool simuart_checkc(int fd)
bool host_uart_checkc(int fd)
{
DWORD size;

View File

@ -482,7 +482,7 @@ static const char *g_white_list[] =
"QuadPart",
/* Ref:
* sim/posix/sim_simuart.c
* sim/posix/sim_hostuart.c
*/
"GetStdHandle",