I did PCI passthrough on Archlinux and Debian with the old PCI-stub method (this was pre-4.0 era). And later I did PCI passthrough on the 4.1+ kernels on Arch and Ubuntu (16.10 I think?).
This is my attempt at doing the same on Nixos.
(defn bytes-to-int | |
([bytes] | |
(bytes-to-int bytes 0)) | |
([bytes offset] | |
(reduce + 0 | |
(map (fn [i] | |
(let [shift (* (- 4 1 i) | |
8)] | |
(bit-shift-left (bit-and (nth bytes (+ i offset)) | |
0x000000FF) |
(defn invoke-private-method [obj fn-name-string & args] | |
(let [m (first (filter (fn [x] (.. x getName (equals fn-name-string))) | |
(.. obj getClass getDeclaredMethods)))] | |
(. m (setAccessible true)) | |
(. m (invoke obj args)))) | |
(defn private-field [obj fn-name-string] | |
(let [m (.. obj getClass (getDeclaredField fn-name-string))] | |
(. m (setAccessible true)) | |
(. m (get obj)))) |
(defmacro defspec-test | |
([name sym-or-syms] `(defspec-test ~name ~sym-or-syms nil)) | |
([name sym-or-syms opts] | |
(when t/*load-tests* | |
`(def ~(vary-meta name assoc :test `(fn [] | |
(let [check-results# (clojure.spec.test/check ~sym-or-syms ~opts) | |
checks-passed?# (every? nil? (map :failure check-results#))] | |
(if checks-passed?# | |
(t/do-report {:type :pass | |
:message (str "Generative tests pass for " |
I did PCI passthrough on Archlinux and Debian with the old PCI-stub method (this was pre-4.0 era). And later I did PCI passthrough on the 4.1+ kernels on Arch and Ubuntu (16.10 I think?).
This is my attempt at doing the same on Nixos.
FAR (Fix (NieR) Automata Resolution) -- Required by HD Texture Pack.