diff options
author | dzwdz | 2022-08-28 14:35:31 +0200 |
---|---|---|
committer | dzwdz | 2022-08-28 14:35:31 +0200 |
commit | 83567c386e4a50cc4303d2c3966d7518331e129f (patch) | |
tree | 1b6c74526310ccb0a7fb84b070ff6810c731729e /src/kernel/arch/amd64/driver/util.h | |
parent | a8e0cd702f97ffc74dd29f4b873e8813b7e9f27c (diff) |
kernel/driver: clean up ps2, add the reqpathcmp() macro
Diffstat (limited to 'src/kernel/arch/amd64/driver/util.h')
-rw-r--r-- | src/kernel/arch/amd64/driver/util.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/kernel/arch/amd64/driver/util.h b/src/kernel/arch/amd64/driver/util.h index bfdd25c..c91605c 100644 --- a/src/kernel/arch/amd64/driver/util.h +++ b/src/kernel/arch/amd64/driver/util.h @@ -3,3 +3,10 @@ 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) |