From 2fe787ba4db420f5b08573d77e35cfaa0d7a0793 Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Fri, 4 Oct 2024 17:28:54 -0600 Subject: wip srv --- cmd/sbc_harness/config/config.h | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'cmd') diff --git a/cmd/sbc_harness/config/config.h b/cmd/sbc_harness/config/config.h index c3c65bf..0e8f43b 100644 --- a/cmd/sbc_harness/config/config.h +++ b/cmd/sbc_harness/config/config.h @@ -3,20 +3,18 @@ * Copyright (C) 2024 Luke T. Shumaker * SPDX-Licence-Identifier: AGPL-3.0-or-later */ -#ifndef _CONFIG_H_ -#define _CONFIG_H_ -/*#include */ - -#if defined(USE_CONFIG_NETIO_POSIX) || defined(USE_CONFIG_COROUTINE) +#if (defined(USE_CONFIG_NETIO_POSIX) || defined(USE_CONFIG_COROUTINE)) && !defined(CONFIG_NETIO_NUM_CONNS) # define CONFIG_NETIO_NUM_CONNS 8 #endif -#ifdef USE_CONFIG_NETIO_POSIX +#if defined(USE_CONFIG_NETIO_POSIX) && !defined(_CONFIG_H_NETIO_POSIX_) +#define _CONFIG_H_NETIO_POSIX_ # define CONFIG_NETIO_ISLINUX 1 /* can we use Linux-kernel-specific fcntls? */ # define CONFIG_NETIO_NUM_PORTS 1 #endif -#ifdef USE_CONFIG_COROUTINE +#if defined(USE_CONFIG_COROUTINE) && !defined(_CONFIG_H_COROUTINE_) +#define _CONFIG_H_COROUTINE_ # define CONFIG_COROUTINE_DEFAULT_STACK_SIZE (16*1024) # define CONFIG_COROUTINE_MEASURE_STACK 1 /* bool */ # define CONFIG_COROUTINE_PROTECT_STACK 1 /* bool */ @@ -25,10 +23,10 @@ 1 /* usb_keyboard */ +\ CONFIG_NETIO_NUM_CONNS /* accept+read */ +\ (2*CONFIG_NETIO_NUM_CONNS) /* work+write */ ) - /*static_assert((CONFIG_COROUTINE_NUM * CONFIG_COROUTINE_DEFAULT_STACK_SIZE) < (264 * 1024)); */ #endif -#ifdef USE_CONFIG_9P +#if defined(USE_CONFIG_9P) && !defined(_CONFIG_H_9P_) +#define _CONFIG_H_9P_ # define CONFIG_9P_PORT 564 /** * This max-msg-size is sized so that a Twrite message can return @@ -48,7 +46,6 @@ * (8*1024)+160 in 2e and 3e. */ # define CONFIG_9P_MAX_MSG_SIZE ((4*1024)+24) -# define CONFIG_9P_MAX_ERR_SIZE 128 /* 128 is what Plan 9 4e uses */ /** * Maximum host-data-structure size. A message may be larger in * unmarshaled-host-structures than marshaled-net-bytes due to (1) @@ -57,5 +54,6 @@ # define CONFIG_9P_MAX_HOSTMSG_SIZE CONFIG_9P_MAX_MSG_SIZE+16 # define CONFIG_9P_MAX_FIDS 16 #endif - -#endif /* _CONFIG_H */ +#if (defined(USE_CONFIG_9P) || defined(_USE_CONFIG_9P_ERR)) && !defined(CONFIG_9P_MAX_ERR_SIZE) +# define CONFIG_9P_MAX_ERR_SIZE 128 /* 128 is what Plan 9 4e uses */ +#endif -- cgit v1.2.3-2-g168b