Commit 38d03000 authored by Tahsin Mutlugun's avatar Tahsin Mutlugun Committed by Benjamin Cabé
Browse files

arch: common: semihost: Move semihost structs into a separate header



Move semihost_x_args structs to include/semihost_types.h so that
semihost implementations can access their elements if needed.

Signed-off-by: default avatarTahsin Mutlugun <Tahsin.Mutlugun@analog.com>
parent d5098a2a
Loading
Loading
Loading
Loading
+46 −0
Original line number Diff line number Diff line
/*
 * 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_ */
+1 −35
Original line number Diff line number Diff line
@@ -8,41 +8,7 @@
#include <string.h>
#include <zephyr/kernel.h>
#include <zephyr/arch/common/semihost.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;
#include "semihost_types.h"

char semihost_poll_in(void)
{