| 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | |
| 3 | //! The `kernel` prelude. |
| 4 | //! |
| 5 | //! These are the most common items used by Rust code in the kernel, |
| 6 | //! intended to be imported by all Rust code, for convenience. |
| 7 | //! |
| 8 | //! # Examples |
| 9 | //! |
| 10 | //! ``` |
| 11 | //! use kernel::prelude::*; |
| 12 | //! ``` |
| 13 | |
| 14 | |
| 15 | pub use |
| 16 | |
| 17 | align_of, |
| 18 | align_of_val, |
| 19 | size_of, |
| 20 | size_of_val, // |
| 21 | , |
| 22 | Pin, // |
| 23 | ; |
| 24 | |
| 25 | |
| 26 | pub use |
| 27 | c_char, |
| 28 | c_int, |
| 29 | c_long, |
| 30 | c_longlong, |
| 31 | c_schar, |
| 32 | c_short, |
| 33 | c_uchar, |
| 34 | c_uint, |
| 35 | c_ulong, |
| 36 | c_ulonglong, |
| 37 | c_ushort, |
| 38 | c_void, |
| 39 | CStr, // |
| 40 | ; |
| 41 | |
| 42 | |
| 43 | pub use |
| 44 | export, |
| 45 | fmt, |
| 46 | kunit_tests, |
| 47 | module, |
| 48 | vtable, // |
| 49 | ; |
| 50 | |
| 51 | |
| 52 | pub use |
| 53 | init, |
| 54 | pin_data, |
| 55 | pin_init, |
| 56 | pinned_drop, |
| 57 | InPlaceWrite, |
| 58 | Init, |
| 59 | PinInit, |
| 60 | Zeroable, // |
| 61 | ; |
| 62 | |
| 63 | |
| 64 | pub use |
| 65 | FromBytes, |
| 66 | IntoBytes, // |
| 67 | ; |
| 68 | |
| 69 | |
| 70 | pub use |
| 71 | FromBytes, |
| 72 | IntoBytes, // |
| 73 | ; |
| 74 | |
| 75 | |
| 76 | pub use |
| 77 | |
| 78 | *, |
| 79 | Box, |
| 80 | KBox, |
| 81 | KVBox, |
| 82 | KVVec, |
| 83 | KVec, |
| 84 | VBox, |
| 85 | VVec, |
| 86 | Vec, // |
| 87 | , |
| 88 | |
| 89 | build_assert, |
| 90 | build_error, |
| 91 | const_assert, |
| 92 | static_assert, // |
| 93 | , |
| 94 | current, |
| 95 | dev_alert, |
| 96 | dev_crit, |
| 97 | dev_dbg, |
| 98 | dev_emerg, |
| 99 | dev_err, |
| 100 | dev_info, |
| 101 | dev_notice, |
| 102 | dev_warn, |
| 103 | |
| 104 | *, |
| 105 | Error, |
| 106 | Result, // |
| 107 | , |
| 108 | InPlaceInit, |
| 109 | pr_alert, |
| 110 | pr_crit, |
| 111 | pr_debug, |
| 112 | pr_emerg, |
| 113 | pr_err, |
| 114 | pr_info, |
| 115 | pr_notice, |
| 116 | pr_warn, |
| 117 | strCStrExt as _, |
| 118 | try_init, |
| 119 | try_pin_init, |
| 120 | UserPtr, |
| 121 | ThisModule, // |
| 122 | ; |
| 123 | |
| 124 | // `super::std_vendor` is hidden, which makes the macro inline for some reason. |
| 125 | |
| 126 | pub use dbg; |