summaryrefslogtreecommitdiff
path: root/src/kernel/arch/amd64/driver/util.h
blob: d89992afd4a794d88aab36c55539d0beaac5cbb7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#pragma once
#include <stdbool.h>
#include <stddef.h>

struct vfs_request;
int req_readcopy(struct vfs_request *req, const void *buf, size_t len);

/* compare request path. path MUST be a static string */
#define reqpathcmp(req, path) _reqpathcmp(req, ""path"", sizeof(path) - 1)
#define _reqpathcmp(req, path, plen) \
	(req->input.kern && \
	 req->input.len == plen && \
	 memcmp(req->input.buf_kern, path, plen) == 0)

void postqueue_join(struct vfs_request **queue, struct vfs_request *req);
bool postqueue_pop(struct vfs_request **queue, void (*accept)(struct vfs_request *));