changelog shortlog graph tags branches files raw help

Mercurial > core / changeset: params and flags

changeset 245: 1b20a166dbe1
parent 244: f89fb3fbffd6
child 246: c910f8e1b346
author: Richard Westhaver <ellis@rwest.io>
date: Wed, 27 Mar 2024 22:04:49 -0400
files: lisp/ffi/uring/uring.lisp
description: params and flags
     1.1--- a/lisp/ffi/uring/uring.lisp	Wed Mar 27 21:45:07 2024 -0400
     1.2+++ b/lisp/ffi/uring/uring.lisp	Wed Mar 27 22:04:49 2024 -0400
     1.3@@ -36,30 +36,41 @@
     1.4 (defmacro define-io-param-flag (name const)
     1.5   "Create a predicate method with NAME which checks for presence of flag
     1.6 CONST in FLAGS slot of IO-PARAMS. A SETF expansion is also defined
     1.7-which accepts a boolean value and automatically adjusts the slot.")
     1.8+which accepts a boolean value and automatically adjusts the slot."
     1.9+  `(progn
    1.10+     (defmethod ,name ((self io-params))
    1.11+       (not (= 0 (logand (io-params-flags self) ,const))))
    1.12+     (defmethod (setf ,name) (val (self io-params))
    1.13+       (with-slots (flags) self
    1.14+         (setf flags (logior flags ,const))))))
    1.15 
    1.16 (defmacro define-io-param-feature (name const)
    1.17   "Create a predicate method with NAME which checks for presence of flag
    1.18 CONST in FEATURES slot of IO-PARAMS. A SETF expansion is also defined
    1.19-which accepts a boolean value and automatically adjust the slot.")
    1.20+which accepts a boolean value and automatically adjust the slot."
    1.21+  `(progn
    1.22+     (defmethod ,name ((self io-params))
    1.23+       (not (= 0 (logand (io-params-features self) ,const))))
    1.24+     (defmethod (setf ,name) (val (self io-params))
    1.25+       (with-slots (features) self
    1.26+         (setf features (logior features ,const))))))
    1.27 
    1.28-;; (define-io-param-flag setup-sqpoll-p ioring-setup-sqpoll)
    1.29-;; (define-io-param-flag setup-iopoll-p ioring-setup-iopoll)
    1.30-;; (define-io-param-flag setup-single-issuer-p ioring-setup-single-issuer)
    1.31-;; (define-io-param-flag setup-iopoll-p ioring-setup-iopoll)
    1.32-;; (define-io-param-feature feat-single-mmap-p ioring-feat-single-mmap)
    1.33-;; (define-io-param-feature feat-nodrop-p ioring-feat-nodrop)
    1.34-;; (define-io-param-feature feat-submit-stable-p ioring-feat-submit-stable)
    1.35-;; (define-io-param-feature feat-rw-cur-pos-p ioring-feat-rw-cur-pos)
    1.36-;; (define-io-param-feature feat-cur-personality-p ioring-feat-cur-personality)
    1.37-;; (define-io-param-feature feat-fast-poll-p ioring-feat-fast-poll-p)
    1.38-;; (define-io-param-feature feat-poll-32bits-p ioring-feat-poll-32bits-p)
    1.39-;; (define-io-param-feature feat-sqpoll-nonfixed-p ioring-feat-sqpoll-nonfixed)
    1.40-;; (define-io-param-feature feat-ext-arg-p ioring-feat-ext-arg)
    1.41-;; (define-io-param-feature feat-native-workers-p ioring-feat-native-workers)
    1.42-;; (define-io-param-feature feat-rsrc-tags-p ioring-feat-rsrc-tags)
    1.43-;; (define-io-param-feature feat-cqe-skip-p ioring-feat-cqe-skip)
    1.44-;; (define-io-param-feature feat-linked-file-p ioring-feat-linked-file)
    1.45+(define-io-param-flag setup-sqpoll-p ioring-setup-sqpoll)
    1.46+(define-io-param-flag setup-iopoll-p ioring-setup-iopoll)
    1.47+(define-io-param-flag setup-single-issuer-p ioring-setup-single-issuer)
    1.48+(define-io-param-feature feat-single-mmap-p ioring-feat-single-mmap)
    1.49+(define-io-param-feature feat-nodrop-p ioring-feat-nodrop)
    1.50+(define-io-param-feature feat-submit-stable-p ioring-feat-submit-stable)
    1.51+(define-io-param-feature feat-rw-cur-pos-p ioring-feat-rw-cur-pos)
    1.52+(define-io-param-feature feat-cur-personality-p ioring-feat-cur-personality)
    1.53+(define-io-param-feature feat-fast-poll-p ioring-feat-fast-poll)
    1.54+(define-io-param-feature feat-poll-32bits-p ioring-feat-poll-32bits)
    1.55+(define-io-param-feature feat-sqpoll-nonfixed-p ioring-feat-sqpoll-nonfixed)
    1.56+(define-io-param-feature feat-ext-arg-p ioring-feat-ext-arg)
    1.57+(define-io-param-feature feat-native-workers-p ioring-feat-native-workers)
    1.58+(define-io-param-feature feat-rsrc-tags-p ioring-feat-rsrc-tags)
    1.59+(define-io-param-feature feat-cqe-skip-p ioring-feat-cqe-skip)
    1.60+(define-io-param-feature feat-linked-file-p ioring-feat-linked-file)
    1.61 
    1.62 (defmethod build ((self io-params) &key &allow-other-keys)
    1.63   (with-slots (sq-entries cq-entries flags sq-thread-cpu sq-thread-idle features wq-fd sq-off cq-off) self