diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-09-24 16:51:51 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-09-24 18:47:13 +0300 |
| commit | fecb86f6093c1e8aed6ab05c29c5af9d0cb93157 (patch) | |
| tree | 10171c839d77167fc98fbae0b315d2c87aa13fa5 /src/snoop.c | |
| parent | b1d67364b4b4832b8efed112f7b0ead1a0b3cd3b (diff) | |
| download | gran-fecb86f6093c1e8aed6ab05c29c5af9d0cb93157.tar.gz gran-fecb86f6093c1e8aed6ab05c29c5af9d0cb93157.zip | |
initial work towards message passing interface
+ As they are currently implemented, grid *may* get stuck if two nodes
try to send to eachother at the same time, I should probably add in
some kind of input buffer as well
Diffstat (limited to 'src/snoop.c')
| -rw-r--r-- | src/snoop.c | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/src/snoop.c b/src/snoop.c deleted file mode 100644 index 23970a8..0000000 --- a/src/snoop.c +++ /dev/null @@ -1,42 +0,0 @@ -/* SPDX-License-Identifier: copyleft-next-0.3.1 */ -/* Copyright 2023 Kim Kuparinen < kimi.h.kuparinen@gmail.com > */ - -#include <stdlib.h> - -#include <gran/snoop.h> - -struct snoop { - enum snoop_state state; - uintptr_t addr; - size_t size; -}; - -struct snoop *create_snoop(uintptr_t addr, size_t size) -{ - struct snoop *snoop = calloc(1, sizeof(struct snoop)); - - snoop->state = SNOOP_UNANSWERED; - snoop->addr = addr; - snoop->size = size; - return snoop; -} - -enum snoop_state snoop_state(struct snoop *snoop) -{ - return snoop->state; -} - -uintptr_t snoop_addr(struct snoop *snoop) -{ - return snoop->addr; -} - -size_t snoop_size(struct snoop *snoop) -{ - return snoop->size; -} - -void destroy_snoop(struct snoop *snoop) -{ - free(snoop); -} |
