Skip to content

Commit

Permalink
fix(kmod): update kernel module macros (#434)
Browse files Browse the repository at this point in the history
Signed-off-by: veqcc <ryuta.kambe@tier4.jp>
  • Loading branch information
veqcc authored Feb 27, 2025
1 parent 194c80c commit aae71fa
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
3 changes: 3 additions & 0 deletions kmod/agnocast.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ static DEFINE_MUTEX(global_mutex);
// Maximum number of referencing Publisher/Subscriber per entry: +1 for the publisher
#define MAX_REFERENCING_PUBSUB_NUM_PER_ENTRY (MAX_SUBSCRIBER_NUM + 1)

// Maximum number of read-only shared memory regions mappable per process
#define MAX_MAP_NUM 8

// Maximum length of topic name: 256 characters
#define TOPIC_NAME_BUFFER_SIZE 256
#define NODE_NAME_BUFFER_SIZE 256
Expand Down
10 changes: 4 additions & 6 deletions kmod/agnocast.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@

#include <linux/types.h>

// TODO: should be made larger when applied for Autoware
#define MAX_PUBLISHER_NUM 4 // At least 4 is required for sample application
#define MAX_SUBSCRIBER_NUM 8 // At least 6 is required for pointcloud topic in Autoware
#define MAX_QOS_DEPTH 10 // Maximum depth of transient local usage part in Autoware
#define MAX_RELEASE_NUM 3 // Maximum number of entry_nodes that can be released at once
#define MAX_MAP_NUM 8 // Max number of read-only shared memory regions mappable per process
#define MAX_PUBLISHER_NUM 4 // Maximum number of publishers per topic
#define MAX_SUBSCRIBER_NUM 16 // Maximum number of subscribers per topic
#define MAX_QOS_DEPTH 10 // Maximum QoS depth for each publisher/subscriber
#define MAX_RELEASE_NUM 3 // Maximum number of entries that can be released at one ioctl

typedef int32_t topic_local_id_t;
struct publisher_shm_info
Expand Down
9 changes: 4 additions & 5 deletions src/agnocastlib/include/agnocast_ioctl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
namespace agnocast
{

// TODO: should be made larger when applied for Autoware
#define MAX_PUBLISHER_NUM 4 // At least 4 is required for sample application
#define MAX_SUBSCRIBER_NUM 8 // At least 6 is required for pointcloud topic in Autoware
#define MAX_QOS_DEPTH 10 // Maximum depth of transient local usage part in Autoware
#define MAX_RELEASE_NUM 3 // Max to keep union size equal to 32 bytes
#define MAX_PUBLISHER_NUM 4 // Maximum number of publishers per topic
#define MAX_SUBSCRIBER_NUM 16 // Maximum number of subscribers per topic
#define MAX_QOS_DEPTH 10 // Maximum QoS depth for each publisher/subscriber
#define MAX_RELEASE_NUM 3 // Maximum number of entries that can be released at one ioctl

using topic_local_id_t = int32_t;
struct publisher_shm_info
Expand Down

0 comments on commit aae71fa

Please sign in to comment.