<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                ## 14.9.?快速參考 許多函數在本章中已經被介紹過; 這是它們全部的一個快速總結. ### 14.9.1.?Kobjects結構 #include <linux/kobject.h> 包含文件, 包含 kobject 的定義, 相關結構, 和函數. ~~~ void kobject_init(struct kobject *kobj); int kobject_set_name(struct kobject *kobj, const char *format, ...); ~~~ 用作 kobject 初始化的函數 ~~~ struct kobject *kobject_get(struct kobject *kobj); void kobject_put(struct kobject *kobj); ~~~ 為 kobjects 管理引用計數的函數. ~~~ struct kobj_type; struct kobj_type *get_ktype(struct kobject *kobj); ~~~ 表示一個kobjct 被嵌入的結構類型. 使用 get_ktype 來獲得關聯到一個給定 kobject 的 kobj_type. ~~~ int kobject_add(struct kobject *kobj); extern int kobject_register(struct kobject *kobj); void kobject_del(struct kobject *kobj); void kobject_unregister(struct kobject *kobj); ~~~ kobject_add 添加一個 kobject 到系統, 處理 kset 成員關系, sysfs 表示, 以及熱插拔事件產生. kobject_register 是一個方便函數, 它結合 kobject_init 和 kobject_add. 使用 kobject_del 來去除一個 kobject 或者 kobject_unregister, 它結合了 kobject_del 和 kobject_put. ~~~ void kset_init(struct kset *kset); int kset_add(struct kset *kset); int kset_register(struct kset *kset); void kset_unregister(struct kset *kset); ~~~ 為 ksets 初始化和注冊的函數. decl_subsys(name, type, hotplug_ops); 易于聲明子系統的一個宏. ~~~ void subsystem_init(struct subsystem *subsys); int subsystem_register(struct subsystem *subsys); void subsystem_unregister(struct subsystem *subsys); struct subsystem *subsys_get(struct subsystem *subsys); void subsys_put(struct subsystem *subsys); ~~~ 對子系統的操作. ### 14.9.2.?sysfs 操作 #include <linux/sysfs.h> 包含 sysfs 聲明的包含文件. ~~~ int sysfs_create_file(struct kobject *kobj, struct attribute *attr); int sysfs_remove_file(struct kobject *kobj, struct attribute *attr); int sysfs_create_bin_file(struct kobject *kobj, struct bin_attribute *attr); int sysfs_remove_bin_file(struct kobject *kobj, struct bin_attribute *attr); int sysfs_create_link(struct kobject *kobj, struct kobject *target, char *name); void sysfs_remove_link(struct kobject *kobj, char *name); ~~~ 創建和去除和一個 kobject 關聯的屬性文件的函數. ### 14.9.3.?總線, 設備, 和驅動 ~~~ int bus_register(struct bus_type *bus); void bus_unregister(struct bus_type *bus); ~~~ 在設備模型中進行注冊和注銷總線的函數. ~~~ int bus_for_each_dev(struct bus_type *bus, struct device *start, void *data, int (*fn)(struct device *, void *)); int bus_for_each_drv(struct bus_type *bus, struct device_driver *start, void *data, int (*fn)(struct device_driver *, void *)); ~~~ 列舉每個設備和驅動的函數, 特別地, 綁定到給定總線的設備. ~~~ BUS_ATTR(name, mode, show, store); int bus_create_file(struct bus_type *bus, struct bus_attribute *attr); void bus_remove_file(struct bus_type *bus, struct bus_attribute *attr); ~~~ BUS_ATTR 宏可能用來聲明一個 bus_attribute 結構, 它可能接著被添加和去除, 使用上面 2 個函數. ~~~ int device_register(struct device *dev); void device_unregister(struct device *dev); ~~~ 處理設備注冊的函數. ~~~ DEVICE_ATTR(name, mode, show, store); int device_create_file(struct device *device, struct device_attribute *entry); void device_remove_file(struct device *dev, struct device_attribute *attr); ~~~ 處理設備屬性的宏和函數. ~~~ int driver_register(struct device_driver *drv); void driver_unregister(struct device_driver *drv); ~~~ 注冊和注銷一個設備驅動的函數. ~~~ DRIVER_ATTR(name, mode, show, store); int driver_create_file(struct device_driver *drv, struct driver_attribute *attr); void driver_remove_file(struct device_driver *drv, struct driver_attribute *attr); ~~~ 關聯驅動屬性的宏和函數. ### 14.9.4.?類 ~~~ struct class_simple *class_simple_create(struct module *owner, char *name); void class_simple_destroy(struct class_simple *cs); struct class_device *class_simple_device_add(struct class_simple *cs, dev_t devnum, struct device *device, const char *fmt, ...); void class_simple_device_remove(dev_t dev); int class_simple_set_hotplug(struct class_simple *cs, int (*hotplug)(struct class_device *dev, char **envp, int num_envp, char *buffer, int buffer_size)); ~~~ 實現 class_simple 接口的函數; 它們管理包含一個 dev 屬性和很少其他屬性的簡單的類入口 ~~~ int class_register(struct class *cls); void class_unregister(struct class *cls); ~~~ 注冊和注銷類. ~~~ CLASS_ATTR(name, mode, show, store); int class_create_file(struct class *cls, const struct class_attribute *attr); void class_remove_file(struct class *cls, const struct class_attribute *attr); ~~~ 處理類屬性的常用宏和函數. ~~~ int class_device_register(struct class_device *cd); void class_device_unregister(struct class_device *cd); int class_device_rename(struct class_device *cd, char *new_name); CLASS_DEVICE_ATTR(name, mode, show, store); int class_device_create_file(struct class_device *cls, const struct class_device_attribute *attr); ~~~ 屬性類設備接口的函數和宏. ~~~ int class_interface_register(struct class_interface *intf); void class_interface_unregister(struct class_interface *intf); ~~~ 添加一個接口到一個類(或去除它)的函數. ### 14.9.5.?固件 ~~~ #include <linux/firmware.h> int request_firmware(const struct firmware **fw, char *name, struct device *device); int request_firmware_nowait(struct module *module, char *name, struct device *device, void *context, void (*cont)(const struct firmware *fw, void *context)); void release_firmware(struct firmware *fw); ~~~ 屬性內核固件加載接口的函數.
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看