diff --git a/arch/common/include/semihost_types.h b/arch/common/include/semihost_types.h new file mode 100644 index 00000000000..277b8d83f3d --- /dev/null +++ b/arch/common/include/semihost_types.h @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2022, Commonwealth Scientific and Industrial Research + * Organisation (CSIRO) ABN 41 687 119 230. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ZEPHYR_INCLUDE_ARCH_COMMON_SEMIHOST_TYPES_H_ +#define ZEPHYR_INCLUDE_ARCH_COMMON_SEMIHOST_TYPES_H_ + +struct semihost_poll_in_args { + long zero; +} __packed; + +struct semihost_open_args { + const char *path; + long mode; + long path_len; +} __packed; + +struct semihost_close_args { + long fd; +} __packed; + +struct semihost_flen_args { + long fd; +} __packed; + +struct semihost_seek_args { + long fd; + long offset; +} __packed; + +struct semihost_read_args { + long fd; + char *buf; + long len; +} __packed; + +struct semihost_write_args { + long fd; + const char *buf; + long len; +} __packed; + +#endif /* ZEPHYR_INCLUDE_ARCH_COMMON_SEMIHOST_TYPES_H_ */ diff --git a/arch/common/semihost.c b/arch/common/semihost.c index f22891c6487..ac25dd29981 100644 --- a/arch/common/semihost.c +++ b/arch/common/semihost.c @@ -8,41 +8,7 @@ #include #include #include - -struct semihost_poll_in_args { - long zero; -} __packed; - -struct semihost_open_args { - const char *path; - long mode; - long path_len; -} __packed; - -struct semihost_close_args { - long fd; -} __packed; - -struct semihost_flen_args { - long fd; -} __packed; - -struct semihost_seek_args { - long fd; - long offset; -} __packed; - -struct semihost_read_args { - long fd; - char *buf; - long len; -} __packed; - -struct semihost_write_args { - long fd; - const char *buf; - long len; -} __packed; +#include "semihost_types.h" char semihost_poll_in(void) {