Skip to content

Handling arrays inside structs. #1193

Answered by superaxander
isubasinghe asked this question in Q&A
Discussion options

You must be logged in to vote

Yes this is a bit of a confusing thing but what you actually need is Perm(tx_queue_clients[client].size, read) without the &.

The following verifies for me with the flag --no-infer-heap-context-into-frame (needed due to #1101)

#include <stdint.h>
#define DRIVER 0
#define CLIENT_CH 1
#define NUM_CLIENTS 3
#define NET_BUFFER_SIZE 2048

struct net_buff_desc {
    /* offset of buffer within buffer memory region or io address of buffer */
    uint64_t io_or_offset;
    /* length of data inside buffer */
    uint16_t len;
};

struct net_queue {
    /* index to insert at */
    uint16_t tail;
    /* index to remove from */
    uint16_t head;
    /* flag to indicate whether consumer requires sign…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by isubasinghe
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants