summaryrefslogtreecommitdiff
path: root/cmd/sbc_harness/config/config.h
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2024-10-04 17:28:54 -0600
committerLuke T. Shumaker <lukeshu@lukeshu.com>2024-10-04 17:28:54 -0600
commit2fe787ba4db420f5b08573d77e35cfaa0d7a0793 (patch)
treeb9c1264b56d713a6df9b029606f87d824f3a3d20 /cmd/sbc_harness/config/config.h
parentb683e779ef83b88f6ffc503a1d1a4f3ec25a5cfa (diff)
wip srv
Diffstat (limited to 'cmd/sbc_harness/config/config.h')
-rw-r--r--cmd/sbc_harness/config/config.h22
1 files changed, 10 insertions, 12 deletions
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 <lukeshu@lukeshu.com>
* SPDX-Licence-Identifier: AGPL-3.0-or-later
*/
-#ifndef _CONFIG_H_
-#define _CONFIG_H_
-/*#include <assert.h>*/
-
-#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