diff --git a/Cargo.lock b/Cargo.lock index 2f3e8c7..daebd2c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,15 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 + +[[package]] +name = "aho-corasick" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba" +dependencies = [ + "memchr", +] [[package]] name = "android_system_properties" @@ -11,6 +20,56 @@ dependencies = [ "libc", ] +[[package]] +name = "anstream" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" + +[[package]] +name = "anstyle-parse" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -37,9 +96,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.2.1" +version = "2.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24a6904aef64d73cf10ab17ebace7befb918b82164785cb89907993be7f83813" +checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06" [[package]] name = "block-buffer" @@ -52,11 +111,10 @@ dependencies = [ [[package]] name = "built" -version = "0.5.2" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b9c056b9ed43aee5e064b683aa1ec783e19c6acec7559e3ae931b7490472fbe" +checksum = "5c0e531d93d39c34eef561e929e8a7f86d77a5af08aac4f6d6e39976c51858e9" dependencies = [ - "cargo-lock", "chrono", "git2", ] @@ -79,18 +137,6 @@ version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" -[[package]] -name = "cargo-lock" -version = "8.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "031718ddb8f78aa5def78a09e90defe30151d1f6c672f937af4dd916429ed996" -dependencies = [ - "semver", - "serde", - "toml", - "url", -] - [[package]] name = "cc" version = "1.0.79" @@ -106,49 +152,127 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527" + +[[package]] +name = "chacha20" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65c35e4b699c7e15ccbe7ee35c005e4fc0a278d22238a2857e6ce2dadeda1b06" +dependencies = [ + "cfg-if", + "cpufeatures 0.3.1", + "rand_core", +] + [[package]] name = "chrono" -version = "0.4.24" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e3c5919066adf22df73762e50cffcde3a758f2a848b113b586d1f86728b673b" +checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327" dependencies = [ "iana-time-zone", - "num-integer", "num-traits", - "winapi", + "windows-link 0.2.1", ] [[package]] -name = "codespan-reporting" -version = "0.11.1" +name = "clap" +version = "4.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +checksum = "aa8876b300ab35ba921adea3dfd70157a46249b33f95c9084ae5709785478946" dependencies = [ - "termcolor", - "unicode-width", + "clap_builder", + "clap_derive", ] [[package]] -name = "convert_case" -version = "0.4.0" +name = "clap-num" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" +checksum = "822c4000301ac390e65995c62207501e3ef800a1fc441df913a5e8e4dc374816" +dependencies = [ + "num-traits", +] [[package]] -name = "core-foundation" -version = "0.6.4" +name = "clap-verbosity-flag" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25b9e03f145fd4f2bf705e07b900cd41fc636598fe5dc452fd0db1441c3f496d" +checksum = "9d92b1fab272fe943881b77cc6e920d6543e5b1bfadbd5ed81c7c5a755742394" dependencies = [ - "core-foundation-sys 0.6.2", - "libc", + "clap", + "log", ] [[package]] -name = "core-foundation-sys" -version = "0.6.2" +name = "clap_builder" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0797fb7aeb1406c84efac526901f7ec3ead2124f946b494e72879d4b54704d" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_complete" +version = "4.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "037e2a1a92236d0aff7e845093f64661d6df4c02c9fcc61a60e9e1d736fa392f" +dependencies = [ + "clap", +] + +[[package]] +name = "clap_derive" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9c751b79415d4e559e3d1fcf128e09e720eb673a06d26cf6f392d37d75b66e0" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[package]] +name = "clap_lex" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c133bc6a41be0d194c306b5506d15e6feeea7b1d6604bd3f8310dfb2ca96486" + +[[package]] +name = "clap_mangen" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "211d617eaa4b735c96c9e0228fcbdb5120ef623f2b8cb67ffb84c3e02dbc28a4" +dependencies = [ + "clap", + "roff", +] + +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width", +] + +[[package]] +name = "colorchoice" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ca8a5221364ef15ce201e8ed2f609fc312682a8f4e0e3d4aa5879764e0fa3b" +checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" [[package]] name = "core-foundation-sys" @@ -165,6 +289,15 @@ dependencies = [ "libc", ] +[[package]] +name = "cpufeatures" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca28b0ae3115b884660db4118d803791fd6756b6e88f39c0f3f7859060d7566" +dependencies = [ + "libc", +] + [[package]] name = "crypto-common" version = "0.1.6" @@ -199,7 +332,7 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.14", + "syn 2.0.119", ] [[package]] @@ -216,20 +349,38 @@ checksum = "2345488264226bf682893e25de0769f3360aac9957980ec49361b083ddaa5bc5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.14", + "syn 2.0.119", +] + +[[package]] +name = "defmt" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4a0795ac740cb54d7b3775c9c17345f6aaecf884c01733b39d6017738e0e3e1" +dependencies = [ + "bitflags 1.3.2", + "defmt-macros", ] [[package]] -name = "derive_more" -version = "0.99.17" +name = "defmt-macros" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +checksum = "840bb056bd99c495c9188198a258ab787c79f306d864db3e6e8451442d6d8366" dependencies = [ - "convert_case", + "defmt-parser", "proc-macro2", "quote", - "rustc_version", - "syn 1.0.109", + "syn 3.0.9", +] + +[[package]] +name = "defmt-parser" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71958f69fb2de856c5dd51ac9377e986ca1aa5919f931bf5395a807277f889a0" +dependencies = [ + "thiserror", ] [[package]] @@ -242,6 +393,16 @@ dependencies = [ "crypto-common", ] +[[package]] +name = "dmidecode" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a898086945b8e1c1e12f0996773ae65442d84f8dcafd5ab88a4c80b1da3d3008" +dependencies = [ + "bitflags 2.13.2", + "uuid", +] + [[package]] name = "embedded-graphics" version = "0.7.1" @@ -266,44 +427,71 @@ dependencies = [ ] [[package]] -name = "float-cmp" -version = "0.8.0" +name = "env_filter" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1267f4ac4f343772758f7b1bdcbe767c218bbab93bb432acbf5162bbf85a6c4" +checksum = "7a1c3cc8e57274ec99de65301228b537f1e4eedc1b8e0f9411c6caac8ae7308f" dependencies = [ - "num-traits", + "log", + "regex", ] [[package]] -name = "form_urlencoded" -version = "1.1.0" +name = "env_logger" +version = "0.11.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0621c04f2196ac3f488dd583365b9c09be011a4ab8b9f37248ffcc8f6198b56a" +dependencies = [ + "anstream", + "anstyle", + "env_filter", + "jiff", + "log", +] + +[[package]] +name = "float-cmp" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +checksum = "e1267f4ac4f343772758f7b1bdcbe767c218bbab93bb432acbf5162bbf85a6c4" dependencies = [ - "percent-encoding", + "num-traits", ] [[package]] name = "framework_lib" -version = "0.3.0" -source = "git+https://github.com/FrameworkComputer/framework-system?branch=adc-laptop12#32ab4f7a2b9fb55f9a53d4b60c17624029ba017b" +version = "0.6.6" +source = "git+https://github.com/FrameworkComputer/framework-system?rev=844d64061120676388cbd741f6ba78469cfcef3a#844d64061120676388cbd741f6ba78469cfcef3a" dependencies = [ "built", - "guid_macros", + "clap", + "clap-num", + "clap-verbosity-flag", + "clap_complete", + "clap_mangen", + "dmidecode", + "env_logger", + "guid-create", "lazy_static", + "libc", "log", + "nix", "no-std-compat", "num", "num-derive", "num-traits", "plain", - "redox_hwio", + "rand", "regex", + "sha1", "sha2", - "smbios-lib", - "spin 0.9.8", + "spin 0.12.3", "uefi", - "uefi-services", + "uefi-raw", + "windows 0.62.2", + "windows-version", + "winreg", + "zerocopy", ] [[package]] @@ -322,29 +510,45 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "084c6b182b01dec54ff12986b9cc8859a9b0d92b074f878c382a4481a070e66e" +[[package]] +name = "getrandom" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "rand_core", +] + [[package]] name = "git2" -version = "0.15.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2994bee4a3a6a51eb90c218523be382fd7ea09b16380b9312e9dbe955ff7c7d1" +checksum = "ddddbf932745a6be37109b6112d3ee09696106f848449069d3a57bba937ab82e" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.13.2", "libc", "libgit2-sys", "log", - "url", ] [[package]] -name = "guid_macros" -version = "0.11.0" -source = "git+https://github.com/FrameworkComputer/framework-system?branch=adc-laptop12#32ab4f7a2b9fb55f9a53d4b60c17624029ba017b" +name = "guid-create" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c525e972d6c182cab88bf69fe99a1a07e153f142453fe44d7e122409c77c5177" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.14", + "winapi", ] +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "iana-time-zone" version = "0.1.56" @@ -352,11 +556,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0722cd7114b7de04316e7ea5456a0bbb20e4adb46fd27a3697adb812cff0f37c" dependencies = [ "android_system_properties", - "core-foundation-sys 0.8.4", + "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows", + "windows 0.48.0", ] [[package]] @@ -369,16 +573,6 @@ dependencies = [ "cxx-build", ] -[[package]] -name = "idna" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "inputmodules" version = "0.4.8" @@ -391,26 +585,52 @@ dependencies = [ "log", "micromath 2.1.0", "uefi", - "uefi-services", "zune-core", "zune-png", ] [[package]] -name = "io-kit-sys" -version = "0.1.0" +name = "is_terminal_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" + +[[package]] +name = "jiff" +version = "0.2.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2b005715dcbeb0089a3c0dab99f2ff1cc3b2525323552703d648585d342a383" +dependencies = [ + "defmt", + "jiff-core", + "jiff-static", + "log", + "portable-atomic", + "portable-atomic-util", + "serde_core", +] + +[[package]] +name = "jiff-core" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f21dcc74995dd4cd090b147e79789f8d65959cbfb5f0b118002db869ea3bd0a0" +checksum = "5e52fe76043ccecc9005d2305ebaadf7d7fc0cc89ca6baa10a94d6bc68c7128c" dependencies = [ - "core-foundation-sys 0.6.2", - "mach 0.2.3", + "defmt", + "log", ] [[package]] -name = "itoa" -version = "1.0.6" +name = "jiff-static" +version = "0.2.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" +checksum = "2cc9817253cf7c7ee4684451bd327e88d6f3658014e54a29198625590650695c" +dependencies = [ + "jiff-core", + "proc-macro2", + "quote", + "syn 2.0.119", +] [[package]] name = "jobserver" @@ -441,15 +661,15 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.161" +version = "0.2.191" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" +checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a" [[package]] name = "libgit2-sys" -version = "0.14.2+1.5.1" +version = "0.18.8+1.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f3d95f6b51075fe9810a7ae22c7095f12b98005ab364d8544797a825ce946a4" +checksum = "7f7c568b25d7489bc3fb2988ed69ab111d2944d2f5fec3d5c987fe545ea97b50" dependencies = [ "cc", "libc", @@ -490,30 +710,15 @@ dependencies = [ [[package]] name = "log" -version = "0.4.17" +version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] +checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6" [[package]] -name = "mach" -version = "0.2.3" +name = "memchr" +version = "2.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86dd2487cdfea56def77b88438a2c915fb45113c5319bfe7e14306ca4cd0b0e1" -dependencies = [ - "libc", -] - -[[package]] -name = "mach" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" -dependencies = [ - "libc", -] +checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" [[package]] name = "micromath" @@ -527,6 +732,18 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3c8dda44ff03a2f238717214da50f65d5a53b45cd213a7370424ffdb6fae815" +[[package]] +name = "nix" +version = "0.31.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf20d2fde8ff38632c426f1165ed7436270b44f199fc55284c38276f9db47c3d" +dependencies = [ + "bitflags 2.13.2", + "cfg-if", + "cfg_aliases", + "libc", +] + [[package]] name = "no-std-compat" version = "0.4.1" @@ -557,13 +774,13 @@ dependencies = [ [[package]] name = "num-derive" -version = "0.4.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +checksum = "e4e98dc3b890f6c23a0f9d3d491a2823d0dea0fa656302a13dd225fa924112a8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.14", + "syn 3.0.9", ] [[package]] @@ -614,10 +831,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] -name = "percent-encoding" -version = "2.2.0" +name = "once_cell_polyfill" +version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" [[package]] name = "pkg-config" @@ -631,48 +848,81 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" +[[package]] +name = "portable-atomic" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85" + +[[package]] +name = "portable-atomic-util" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10ab3eb7f3becc3a1cbc4f2c6f20267996cfc1a6467a873763411b136a122715" +dependencies = [ + "portable-atomic", +] + [[package]] name = "proc-macro2" -version = "1.0.56" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" +checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" dependencies = [ "unicode-ident", ] [[package]] name = "ptr_meta" -version = "0.2.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcada80daa06c42ed5f48c9a043865edea5dc44cbf9ac009fda3b89526e28607" +checksum = "743da816b98c921cdbe8628ef7381b76f25ecf4da599fc80aca90eae7ef70cc0" dependencies = [ "ptr_meta_derive", ] [[package]] name = "ptr_meta_derive" -version = "0.2.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bca9224df2e20e7c5548aeb5f110a0f3b77ef05f8585139b7148b59056168ed2" +checksum = "1c8d9ca532f185d5d4db7a7c9d51420b452168ea1c2b913953281bd6fe1fcbd0" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 3.0.9", ] [[package]] name = "quote" -version = "1.0.26" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" +checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" dependencies = [ "proc-macro2", ] [[package]] -name = "redox_hwio" -version = "0.1.6" -source = "git+https://github.com/FrameworkComputer/rust-hwio?branch=freebsd#9bcff4277d8f3d7dce2b12c6ad81d092ae35c4ba" +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + +[[package]] +name = "rand" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65c9fb96cbc91e3478eaae79a69fcd3f1ae4ad052e471fe6732fff548984b4af" +dependencies = [ + "chacha20", + "getrandom", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69" [[package]] name = "regex" @@ -680,6 +930,8 @@ version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ + "aho-corasick", + "memchr", "regex-automata", "regex-syntax", ] @@ -690,6 +942,8 @@ version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" dependencies = [ + "aho-corasick", + "memchr", "regex-syntax", ] @@ -700,19 +954,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - -[[package]] -name = "ryu" -version = "1.0.13" +name = "roff" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +checksum = "323c417e1d9665a65b263ec744ba09030cfb277e9daa0b018a4ab62e57bc8189" [[package]] name = "scopeguard" @@ -727,43 +972,34 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1" [[package]] -name = "semver" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" -dependencies = [ - "serde", -] - -[[package]] -name = "serde" -version = "1.0.160" +name = "serde_core" +version = "1.0.229" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2f3770c8bce3bcda7e149193a069a0f4365bda1fa5cd88e03bca26afc1216c" +checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.160" +version = "1.0.229" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291a097c63d8497e00160b166a967a4a79c64f3facdd01cbd7502231688d77df" +checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" dependencies = [ "proc-macro2", "quote", - "syn 2.0.14", + "syn 3.0.9", ] [[package]] -name = "serde_json" -version = "1.0.95" +name = "sha1" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d721eca97ac802aa7777b701877c8004d950fc142651367300d21c1cc0194744" +checksum = "a978451301f4db1d02937a4ab3ccce137717b81826e79b7d49ffe3244a13c3b8" dependencies = [ - "itoa", - "ryu", - "serde", + "cfg-if", + "cpufeatures 0.2.14", + "digest", ] [[package]] @@ -773,7 +1009,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", - "cpufeatures", + "cpufeatures 0.2.14", "digest", ] @@ -783,21 +1019,6 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "238abfbb77c1915110ad968465608b68e869e0772622c9656714e73e5a1a522f" -[[package]] -name = "smbios-lib" -version = "0.9.1" -source = "git+https://github.com/FrameworkComputer/smbios-lib.git?branch=no-std#b3e2fff8a6f4b8c2d729467cbbf0c8c41974cd1c" -dependencies = [ - "core-foundation", - "core-foundation-sys 0.6.2", - "io-kit-sys", - "libc", - "mach 0.3.2", - "no-std-compat", - "serde", - "serde_json", -] - [[package]] name = "spin" version = "0.5.2" @@ -806,13 +1027,19 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "spin" -version = "0.9.8" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +checksum = "0134f9043ed38b087ac4f7d4af44c79e2c9e5094421fe3164f435ce585953b10" dependencies = [ "lock_api", ] +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + [[package]] name = "syn" version = "1.0.109" @@ -826,9 +1053,20 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.14" +version = "2.0.119" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "3.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcf316d5356ed6847742d036f8a39c3b8435cac10bd528a4bd461928a6ab34d5" +checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b" dependencies = [ "proc-macro2", "quote", @@ -845,27 +1083,23 @@ dependencies = [ ] [[package]] -name = "tinyvec" -version = "1.6.0" +name = "thiserror" +version = "2.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "09e52cb86a36cede5cb101bf8908837b3e4c6e5e59fe7fd85c23fb56200d189e" dependencies = [ - "tinyvec_macros", + "thiserror-impl", ] [[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - -[[package]] -name = "toml" -version = "0.5.11" +name = "thiserror-impl" +version = "2.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524" dependencies = [ - "serde", + "proc-macro2", + "quote", + "syn 3.0.9", ] [[package]] @@ -876,52 +1110,55 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "ucs2" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bad643914094137d475641b6bab89462505316ec2ce70907ad20102d28a79ab8" +checksum = "df79298e11f316400c57ec268f3c2c29ac3c4d4777687955cd3d4f3a35ce7eba" dependencies = [ "bit_field", ] [[package]] name = "uefi" -version = "0.20.0" -source = "git+https://github.com/FrameworkComputer/uefi-rs?branch=merged#95165e1adde99da7a460320538d908af8b55f87f" +version = "0.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368cef7d94514897e6dad4350945c7910a9f5bf9021191d1c58ee3ec09962697" dependencies = [ - "bitflags 1.3.2", - "derive_more", + "bitflags 2.13.2", + "cfg-if", "log", "ptr_meta", "ucs2", "uefi-macros", + "uefi-raw", + "uguid", ] [[package]] name = "uefi-macros" -version = "0.11.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0caeb0e7b31b9f1f347e541106be10aa8c66c76fa722a3298a4cd21433fabd4" +checksum = "643efa8b64be89780bc498b290fab04337c7c4d171cc82cce2e133a74616dcc4" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 3.0.9", ] [[package]] -name = "uefi-services" +name = "uefi-raw" version = "0.17.0" -source = "git+https://github.com/FrameworkComputer/uefi-rs?branch=merged#95165e1adde99da7a460320538d908af8b55f87f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3636327a6d88a38c0f2567fb695ec7ba27b3483d1877730486605aa0866da201" dependencies = [ - "cfg-if", - "log", - "uefi", + "bitflags 2.13.2", + "uguid", ] [[package]] -name = "unicode-bidi" -version = "0.3.13" +name = "uguid" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "0c8352f8c05e47892e7eaf13b34abd76a7f4aeaf817b716e88789381927f199c" [[package]] name = "unicode-ident" @@ -929,15 +1166,6 @@ version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" -[[package]] -name = "unicode-normalization" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" -dependencies = [ - "tinyvec", -] - [[package]] name = "unicode-width" version = "0.1.10" @@ -945,15 +1173,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" [[package]] -name = "url" -version = "2.3.1" +name = "utf8parse" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", -] +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "uuid" +version = "1.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a0e2d11620c50695fe12bbbfde96b3477fe606e7284c22d505c12ce51214514" [[package]] name = "vcpkg" @@ -1061,6 +1290,122 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "windows" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "527fadee13e0c05939a6a05d5bd6eec6cd2e3dbd648b9f8e447c6518133d8580" +dependencies = [ + "windows-collections", + "windows-core", + "windows-future", + "windows-numerics", +] + +[[package]] +name = "windows-collections" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b2d95af1a8a14a3c7367e1ed4fc9c20e0a26e79551b1454d72583c97cc6610" +dependencies = [ + "windows-core", +] + +[[package]] +name = "windows-core" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link 0.2.1", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-future" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d6f90251fe18a279739e78025bd6ddc52a7e22f921070ccdc67dde84c605cb" +dependencies = [ + "windows-core", + "windows-link 0.2.1", + "windows-threading", +] + +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-link" +version = "0.100.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b39de7c7fe78858b0144c50c3fc000bab3be17d5e9b85b1053871693c7f7415" + +[[package]] +name = "windows-numerics" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e2e40844ac143cdb44aead537bbf727de9b044e107a0f1220392177d15b0f26" +dependencies = [ + "windows-core", + "windows-link 0.2.1", +] + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link 0.2.1", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link 0.2.1", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link 0.2.1", +] + [[package]] name = "windows-targets" version = "0.48.0" @@ -1076,6 +1421,24 @@ dependencies = [ "windows_x86_64_msvc", ] +[[package]] +name = "windows-threading" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3949bd5b99cafdf1c7ca86b43ca564028dfe27d66958f2470940f73d86d75b37" +dependencies = [ + "windows-link 0.2.1", +] + +[[package]] +name = "windows-version" +version = "0.100.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5d2a42ae19ff386c4680514519a225a2a99bcfada6aff0ab3766f928ff84365" +dependencies = [ + "windows-link 0.100.0", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.48.0" @@ -1118,13 +1481,43 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +[[package]] +name = "winreg" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d6f32a0ff4a9f6f01231eb2059cc85479330739333e0e58cadf03b6af2cca10" +dependencies = [ + "cfg-if", + "windows-sys", +] + +[[package]] +name = "zerocopy" +version = "0.8.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5fe1f8f1b06191a00962174c61aa5005e0bb391a6d80d07e24d115c01a92ed8" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "863ad3ac83293fb4d740aedbfdc9240dd8d1a50c1099acd76ce80ce7c7230c7f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + [[package]] name = "zune-core" version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29ca36c2e02af0d8d7ee977542bfe33ed1c516be73d3c1faa4420af46e96ceee" dependencies = [ - "bitflags 2.2.1", + "bitflags 2.13.2", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 7d2f145..1e3087e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "inputmodules" version = "0.4.8" edition = "2021" -rust-version = "1.61" +rust-version = "1.89" build = "build.rs" [features] @@ -12,24 +12,17 @@ azalea = [] default = ["12in"] [build-dependencies] -built = { version = "0.5", no-default-features = true, features = ["chrono", "git2"] } +built = { version = "0.8", default-features = false, features = ["chrono", "git2"] } [dependencies] cfg-if = "1.0.0" embedded-graphics = "0.7.1" getargs = { version = "0.5.0", default-features = false } log = "0.4" -uefi = { version = "0.20", features = ["alloc"] } -uefi-services = "0.17" +uefi = { version = "0.41", features = ["alloc", "global_allocator", "logger", "panic_handler"] } zune-core = "0.2.14" micromath = "2.1.0" -# Temporarily override because we need pending PRs for -# for the Shell and ShellParameters protocols -[patch.crates-io] -uefi = { git = "https://github.com/FrameworkComputer/uefi-rs", branch = "merged" } -uefi-services = { git = "https://github.com/FrameworkComputer/uefi-rs", branch = "merged" } - [dependencies.zune-png] version = "0.2.1" default-features = false @@ -37,9 +30,7 @@ default-features = false [dependencies.framework_lib] # path = "/home/zoid/clone/framework-system/framework_lib" git = "https://github.com/FrameworkComputer/framework-system" -# rev = "32ab4f7a2b9fb55f9a53d4b60c17624029ba017b" -# Based on 3da46424ad9fac924bb83e9a2f87dda73c971752 -branch = "adc-laptop12" +rev = "844d64061120676388cbd741f6ba78469cfcef3a" features = ["uefi"] default-features = false diff --git a/src/drawing_12in.rs b/src/drawing_12in.rs index ce60f5c..6271987 100644 --- a/src/drawing_12in.rs +++ b/src/drawing_12in.rs @@ -15,8 +15,8 @@ use framework_lib::chromium_ec::commands::*; use framework_lib::power::{AccelData, LidAngle, ReducedPowerInfo}; #[allow(unused_imports)] use log::{debug, error, info, trace}; +use uefi::boot::ScopedProtocol; use uefi::proto::console::gop::GraphicsOutput; -use uefi::table::boot::ScopedProtocol; use zune_core::result::DecodingResult; use zune_png::PngDecoder; diff --git a/src/ec_comm.rs b/src/ec_comm.rs index 5086273..3438b18 100644 --- a/src/ec_comm.rs +++ b/src/ec_comm.rs @@ -838,7 +838,7 @@ pub fn get_als_data(ec: &Option) -> u32 { return 0; }; - get_als_reading(ec).unwrap_or(0) + get_als_reading(ec, 0).unwrap_or(0) } pub fn get_accel_reading(ec: &Option) -> (AccelData, AccelData, LidAngle) { diff --git a/src/gui_12in.rs b/src/gui_12in.rs index 3fa7d89..e9c178c 100644 --- a/src/gui_12in.rs +++ b/src/gui_12in.rs @@ -10,16 +10,15 @@ use framework_lib::chromium_ec::input_deck::InputDeckState; use framework_lib::chromium_ec::{CrosEc, EcRequestRaw}; #[allow(unused_imports)] use log::{debug, error, info}; +use uefi::boot::{self, OpenProtocolAttributes, OpenProtocolParams, SearchType}; use uefi::proto::console::gop::GraphicsOutput; use uefi::proto::console::text::{Input, Key, ScanCode}; -use uefi::table::boot::BootServices; -use uefi::table::boot::{OpenProtocolAttributes, OpenProtocolParams, SearchType}; use uefi::Identify; use uefi::Result; #[allow(unused_imports)] use uefi::{prelude::*, Char16}; #[allow(unused_imports)] -use uefi_services::{print, println}; +use uefi::{print, println}; use embedded_graphics::{ image::Image, @@ -124,7 +123,7 @@ pub fn get_input_deck( } } -pub fn draw_background(bs: &BootServices, st: &SystemTable, ec: &Option) -> Result { +pub fn draw_background(ec: &Option) -> Result { let emulated_deck = InputDeckStatus12In { chassis_closed: false, pwrbtn_present: false, @@ -160,7 +159,7 @@ pub fn draw_background(bs: &BootServices, st: &SystemTable, ec: &Option, ec: &Option( + boot::open_protocol::( OpenProtocolParams { handle: *handle, - agent: bs.image_handle(), + agent: boot::image_handle(), controller: None, }, OpenProtocolAttributes::GetProtocol, @@ -294,8 +293,8 @@ pub fn draw_background(bs: &BootServices, st: &SystemTable, ec: &Option().unwrap(); - let mut input = bs.open_protocol_exclusive::(input_handle).unwrap(); + let input_handle = boot::get_handle_for_protocol::().unwrap(); + let mut input = boot::open_protocol_exclusive::(input_handle).unwrap(); let zero_key = Char16::try_from('0').unwrap(); let one_key = Char16::try_from('1').unwrap(); @@ -331,17 +330,12 @@ pub fn draw_background(bs: &BootServices, st: &SystemTable, ec: &Option, ec: &Option usize { + let mut len = 0; + // Volatile read, so LLVM can't turn this loop into a call to itself + while core::ptr::read_volatile(s.add(len)) != 0 { + len += 1; + } + len +} + #[entry] -fn main(image_handle: Handle, mut system_table: SystemTable) -> Status { - let event = uefi_services::init(&mut system_table).unwrap(); - let boot_services = system_table.boot_services(); +fn main() -> Status { + uefi::helpers::init().unwrap(); // Only error prints in release build #[cfg(not(debug_assertions))] @@ -52,7 +68,7 @@ fn main(image_handle: Handle, mut system_table: SystemTable) -> Status { //#[cfg(debug_assertions)] //log::set_max_level(log::LevelFilter::Trace); - let arg = get_shell_action(boot_services); + let arg = get_shell_action(); if let Ok(ShellAction::Info) = arg { println!("Provide Parameter: 'gui' to launch UI and show issues"); println!("Provide Parameter: 'force' to launch UI even if everything is ok"); @@ -64,7 +80,7 @@ fn main(image_handle: Handle, mut system_table: SystemTable) -> Status { print_12in_status(); } else if let Ok(ShellAction::GopInfo) = arg { println!("GOP Info"); - util::print_gop_info(boot_services); + util::print_gop_info(); } else { info!("No shell arg, launching GUI"); @@ -76,29 +92,22 @@ fn main(image_handle: Handle, mut system_table: SystemTable) -> Status { ec_comm::set_uefi_app_mode(&ec, true); let quick_boot = !matches!(arg, Ok(ShellAction::Force)); #[cfg(not(feature = "12in"))] - let gui_res = state_machine::start(boot_services, &system_table, &ec, quick_boot); + let gui_res = state_machine::start(&ec, quick_boot); #[cfg(feature = "12in")] - let gui_res = state_machine_12in::start(boot_services, &system_table, &ec, quick_boot); + let gui_res = state_machine_12in::start(&ec, quick_boot); ec_comm::set_uefi_app_mode(&ec, false); let reset = gui_res.unwrap(); if let Some(reset_type) = reset { #[cfg(debug_assertions)] info!("Shutting down"); - boot_services.stall(1_000_000); + boot::stall(core::time::Duration::from_micros(1_000_000)); // Shut down the system - // TODO: I should do this outside of this function - let rt = system_table.runtime_services(); - rt.reset(reset_type, Status::SUCCESS, None); + uefi::runtime::reset(reset_type, Status::SUCCESS, None); } } - if let Some(event) = event { - // Will crash when Linux boots if we don't call this - boot_services.close_event(event).unwrap(); - } - Status::SUCCESS } @@ -110,17 +119,17 @@ enum ShellAction { GopInfo, } -fn get_shell_action(boot_services: &BootServices) -> uefi::Result { +fn get_shell_action() -> uefi::Result { // TODO: I think I should open this from the ImageHandle? let shell_params_h = - boot_services.locate_handle_buffer(SearchType::ByProtocol(&ShellParameters::GUID))?; - trace!("Found {} ShellParameters handles", (*shell_params_h).len()); - for handle in &*shell_params_h { + boot::locate_handle_buffer(SearchType::ByProtocol(&ShellParameters::GUID))?; + trace!("Found {} ShellParameters handles", shell_params_h.len()); + for handle in shell_params_h.iter() { let params_handle = unsafe { - boot_services.open_protocol::( + boot::open_protocol::( OpenProtocolParams { handle: *handle, - agent: boot_services.image_handle(), + agent: boot::image_handle(), controller: None, }, OpenProtocolAttributes::GetProtocol, @@ -129,11 +138,11 @@ fn get_shell_action(boot_services: &BootServices) -> uefi::Result { // Ehm why are there two and one has no args? // Maybe one is the shell itself? - if params_handle.argc == 0 { + if params_handle.args_len() == 0 { continue; } - let args = params_handle.get_args(); + let args: Vec = params_handle.args().map(|arg| arg.to_string()).collect(); // First arg is the executable path return Ok(if args.len() == 2 && args[1] == "gui" { ShellAction::Gui diff --git a/src/sleep.rs b/src/sleep.rs index a5bdab9..ec17407 100644 --- a/src/sleep.rs +++ b/src/sleep.rs @@ -1,24 +1,22 @@ use core::ffi::c_void; use core::ptr::NonNull; +use core::time::Duration; -#[allow(unused_imports)] -use uefi::prelude::*; -use uefi::table::boot::{BootServices, EventType, Tpl}; +use uefi::boot::{self, EventType, TimerTrigger, Tpl}; use uefi::Event; unsafe extern "efiapi" fn idle_callback(_event: Event, _context: Option>) {} // Continue execution after a timeout or when the event fires // This is much better than gBS->Stall because it'll actually pause the CPU instead of busywaiting. -pub fn sleep_or(bs: &BootServices, ms: u64, or_event: Option) { +pub fn sleep_or(ms: u64, or_event: Option) { let oneshot_timer = unsafe { - bs.create_event(EventType::TIMER, Tpl::CALLBACK, Some(idle_callback), None) - .unwrap() + boot::create_event(EventType::TIMER, Tpl::CALLBACK, Some(idle_callback), None).unwrap() }; - bs.set_timer( + boot::set_timer( &oneshot_timer, - uefi::table::boot::TimerTrigger::Relative(ms * 10_000), + TimerTrigger::Relative(Duration::from_millis(ms)), ) .unwrap(); @@ -27,5 +25,5 @@ pub fn sleep_or(bs: &BootServices, ms: u64, or_event: Option) { } else { [unsafe { oneshot_timer.unsafe_clone() }, oneshot_timer] }; - let _which_event_fired = bs.wait_for_event(&mut events).discard_errdata().unwrap(); + let _which_event_fired = boot::wait_for_event(&mut events).unwrap(); } diff --git a/src/state_machine_12in.rs b/src/state_machine_12in.rs index 0ac4002..f29120e 100644 --- a/src/state_machine_12in.rs +++ b/src/state_machine_12in.rs @@ -16,12 +16,11 @@ use framework_lib::power::{self, get_accel_data, AccelData, LidAngle, ReducedPow #[allow(unused_imports)] use log::{debug, error, info, trace}; use log::{log_enabled, Level}; -use uefi::prelude::BootServices; +use uefi::boot; use uefi::proto::console::text::{Key, ScanCode}; -use uefi::table::{Boot, SystemTable}; use uefi::Char16; #[allow(unused_imports)] -use uefi_services::{print, println, system_table}; +use uefi::{print, println}; use crate::buffer::Buffer; use crate::built_info; @@ -253,11 +252,9 @@ impl State { } pub fn start( - bs: &BootServices, - st: &SystemTable, ec: &Option, quick_boot: bool, -) -> uefi::Result> { +) -> uefi::Result> { let mut input_deck = ec_comm::get_input_deck(ec); let mut hw_diag = ec_comm::get_hw_diag(ec); let mut accel_reading = ec_comm::get_accel_reading(ec); @@ -285,7 +282,7 @@ pub fn start( // } // Get GOP protocol to draw on the screen - let (mut gop, mut buffer, original_mode) = if let Some(res) = util::get_gop_buffer(bs) { + let (mut gop, mut buffer, original_mode) = if let Some(res) = util::get_gop_buffer() { res } else { // Something went wrong with GOP initialization, keep booting @@ -294,7 +291,7 @@ pub fn start( }; // Get Input protocol to detect keypresses - let mut input = util::get_input_protocol(bs).expect("Should always have input protocol"); + let mut input = util::get_input_protocol().expect("Should always have input protocol"); let mut state = State::new(); let mut long_press = 0; @@ -332,15 +329,14 @@ pub fn start( } if state.keypress == Some(Key::Special(ScanCode::FUNCTION_12)) { - let rt = st.runtime_services(); - util::set_os_indications_setupmenu(rt); - return Ok(Some(uefi::table::runtime::ResetType::Cold)); + util::set_os_indications_setupmenu(); + return Ok(Some(uefi::runtime::ResetType::COLD)); } let need_redraw = state.need_redraw(&input_deck, &hw_diag, &power_info, &accel_reading); if need_redraw && log_enabled!(Level::Debug) { // Sleep after state.need_redraw prints debug information - bs.stall(1_000_000); + boot::stall(core::time::Duration::from_micros(1_000_000)); } let q_key = Char16::try_from('?').unwrap(); @@ -359,12 +355,10 @@ pub fn start( // && !need_redraw { if long_press > 4 { // Exit and signal that we need to poweroff - return Ok(Some(uefi::table::runtime::ResetType::Shutdown)); + return Ok(Some(uefi::runtime::ResetType::SHUTDOWN)); } // Wait a second - sleep_or(bs, 1_000, unsafe { - Some(input.wait_for_key_event().unsafe_clone()) - }); + sleep_or(1_000, input.wait_for_key_event().ok()); long_press += 1; true } else { @@ -403,9 +397,7 @@ pub fn start( // TODO: It needs to be very low to detect short power button presses, // but it doesn't have to be that low for the input modules. Maybe we can find a compromise // Put CPU to sleep until key press or 10ms timeout - sleep_or(bs, 10, unsafe { - Some(input.wait_for_key_event().unsafe_clone()) - }); + sleep_or(10, input.wait_for_key_event().ok()); state.keypress = input.read_key().expect(FAILED_INPUT); // Save current values to access and compare them in next iteration diff --git a/src/util.rs b/src/util.rs index 7c4b82d..11ff9d2 100644 --- a/src/util.rs +++ b/src/util.rs @@ -2,23 +2,22 @@ use embedded_graphics::prelude::Point; #[allow(unused_imports)] use log::{debug, error, info, trace}; -use uefi::prelude::{BootServices, RuntimeServices}; +use uefi::boot::{self, OpenProtocolAttributes, OpenProtocolParams, ScopedProtocol, SearchType}; use uefi::proto::console::gop::{GraphicsOutput, Mode}; use uefi::proto::console::text::Input; -use uefi::table::boot::{OpenProtocolAttributes, OpenProtocolParams, ScopedProtocol, SearchType}; -use uefi::table::runtime::{VariableAttributes, VariableVendor}; +use uefi::runtime::{VariableAttributes, VariableVendor}; use uefi::{cstr16, guid, Identify}; #[allow(unused_imports)] -use uefi_services::{print, println, system_table}; +use uefi::{print, println}; use crate::buffer::Buffer; const EFI_OS_INDICATIONS_BOOT_TO_FW_UI: u64 = 0x0000000000000001; const EFI_GLOBAL_VARIABLE_GUID: uefi::Guid = guid!("8be4df61-93ca-11d2-aa0d-00e098032b8c"); -pub fn print_gop_info(bs: &BootServices) -> Option<()> { +pub fn print_gop_info() -> Option<()> { let gop_handles = if let Ok(gop_handles) = - bs.locate_handle_buffer(SearchType::ByProtocol(&GraphicsOutput::GUID)) + boot::locate_handle_buffer(SearchType::ByProtocol(&GraphicsOutput::GUID)) { gop_handles } else { @@ -28,10 +27,10 @@ pub fn print_gop_info(bs: &BootServices) -> Option<()> { let gop = if let Some(handle) = gop_handles.iter().next() { unsafe { - bs.open_protocol::( + boot::open_protocol::( OpenProtocolParams { handle: *handle, - agent: bs.image_handle(), + agent: boot::image_handle(), controller: None, }, OpenProtocolAttributes::GetProtocol, @@ -56,11 +55,9 @@ pub fn print_gop_info(bs: &BootServices) -> Option<()> { Some(()) } -pub fn get_gop_buffer( - bs: &BootServices, -) -> Option<(ScopedProtocol, Buffer, Option)> { +pub fn get_gop_buffer() -> Option<(ScopedProtocol, Buffer, Option)> { let gop_handles = if let Ok(gop_handles) = - bs.locate_handle_buffer(SearchType::ByProtocol(&GraphicsOutput::GUID)) + boot::locate_handle_buffer(SearchType::ByProtocol(&GraphicsOutput::GUID)) { gop_handles } else { @@ -70,10 +67,10 @@ pub fn get_gop_buffer( let mut gop = if let Some(handle) = gop_handles.iter().next() { unsafe { - bs.open_protocol::( + boot::open_protocol::( OpenProtocolParams { handle: *handle, - agent: bs.image_handle(), + agent: boot::image_handle(), controller: None, }, OpenProtocolAttributes::GetProtocol, @@ -124,21 +121,22 @@ pub fn get_gop_buffer( Some((gop, Buffer::new(width, height), original_mode)) } -pub fn get_input_protocol(bs: &BootServices) -> Option> { - let input_handles = - if let Ok(input_handles) = bs.locate_handle_buffer(SearchType::ByProtocol(&Input::GUID)) { - input_handles - } else { - info!("Input protocol is missing"); - return None; - }; +pub fn get_input_protocol() -> Option> { + let input_handles = if let Ok(input_handles) = + boot::locate_handle_buffer(SearchType::ByProtocol(&Input::GUID)) + { + input_handles + } else { + info!("Input protocol is missing"); + return None; + }; if let Some(handle) = input_handles.iter().next() { unsafe { - bs.open_protocol::( + boot::open_protocol::( OpenProtocolParams { handle: *handle, - agent: bs.image_handle(), + agent: boot::image_handle(), controller: None, }, OpenProtocolAttributes::GetProtocol, @@ -152,34 +150,32 @@ pub fn get_input_protocol(bs: &BootServices) -> Option> { } // Avoid using because it might cause trouble with later boot process -fn _get_exclusive_input_protocol(bs: &BootServices) -> Option> { - let input_handle = bs.get_handle_for_protocol::().ok()?; - bs.open_protocol_exclusive::(input_handle).ok() +fn _get_exclusive_input_protocol() -> Option> { + let input_handle = boot::get_handle_for_protocol::().ok()?; + boot::open_protocol_exclusive::(input_handle).ok() } /// Set OS indications so that a reboot will boot into setup menu -pub fn set_os_indications_setupmenu(rt: &RuntimeServices) { +pub fn set_os_indications_setupmenu() { let vendor = VariableVendor(EFI_GLOBAL_VARIABLE_GUID); let mut buf = [0; 8]; - rt.get_variable(cstr16!("OsIndicationsSupported"), &vendor, &mut buf) + uefi::runtime::get_variable(cstr16!("OsIndicationsSupported"), &vendor, &mut buf) .expect("failed to get variable"); let os_indications: u64 = u64::from_ne_bytes(buf); debug!("OS Indications: {:?}", os_indications); - let os_indications = if rt - .get_variable(cstr16!("OsIndications"), &vendor, &mut buf) - .is_ok() - { - u64::from_ne_bytes(buf) | EFI_OS_INDICATIONS_BOOT_TO_FW_UI - } else { - EFI_OS_INDICATIONS_BOOT_TO_FW_UI - }; + let os_indications = + if uefi::runtime::get_variable(cstr16!("OsIndications"), &vendor, &mut buf).is_ok() { + u64::from_ne_bytes(buf) | EFI_OS_INDICATIONS_BOOT_TO_FW_UI + } else { + EFI_OS_INDICATIONS_BOOT_TO_FW_UI + }; debug!("OS Indications: {:?}", os_indications); let attrs = VariableAttributes::NON_VOLATILE | VariableAttributes::BOOTSERVICE_ACCESS | VariableAttributes::RUNTIME_ACCESS; - rt.set_variable( + uefi::runtime::set_variable( cstr16!("OsIndications"), &vendor, attrs,