linux内核常用头文件之-----linux/kobject.h

本文介绍了Linux内核中的kobject结构,它是sysfs文件系统创建目录和文件时使用的关键类型。kobject头文件包含kobject的定义、kobject的相关操作函数,以及用于事件通知的枚举类型。该头文件对于理解和使用sysfs至关重要。
摘要由CSDN通过智能技术生成

/**在这个头文件中定义了kobject结构类型 kobject类型是sysfs文件系统创建目录和文件的时候使用的类型*/

/*
 * kobject.h - generic kernel object infrastructure.
 *
 * Copyright (c) 2002-2003 Patrick Mochel
 * Copyright (c) 2002-2003 Open Source Development Labs
 * Copyright (c) 2006-2008 Greg Kroah-Hartman <greg@kroah.com>
 * Copyright (c) 2006-2008 Novell Inc.
 *
 * This file is released under the GPLv2.
 *
 * Please read Documentation/kobject.txt before using the kobject
 * interface, ESPECIALLY the parts about reference counts and object
 * destructors.
 */


#ifndef _KOBJECT_H_
#define _KOBJECT_H_


#include <linux/types.h>
#include <linux/list.h>
#include <linux/sysfs.h>
#include <linux/compiler.h>
#include <linux/spinlock.h>
#include <linux/kref.h>
#include <linux/kobject_ns.h>
#include <linux/kernel.h>
#include <linux/wait.h>
#include <asm/atomic.h>


#define UEVENT_HELPER_PATH_LEN 256
#define UEVENT_NUM_ENVP 32 /* number of env pointers */
#define UEVENT_BUFFER_SIZE 2048 /* buffer for the variables */


/* path to the userspace helper executed on an event */
extern char uevent_helper[];


/* counter to tag the uevent, read only except for the kobject core */
extern u64 uevent_seqnum;


/*
 * The actions here must match the index to the string array
 * in lib/kobject_uevent.c
 *
 * Do not add new actions here without checking with the driver-core
 * maintainers. Action strings are not meant to express subsystem
 * or device specific properties. In most cases you want to send a
 * kobject_uevent_env(kobj, KOBJ_CHANGE, env) with additional event
 * specific variables added to the event environment.
 */
enum kobject_action {
KOBJ_ADD,
KOBJ_REMOVE,
KOBJ_CHANGE,

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
这个命令是一个编译 `ffplay.c` 文件的命令,其中包含了 FFmpeg 库和 SDL 库的头文件路径和库文件路径。 具体来说,`-I` 选项用于指定头文件路径,`-L` 选项用于指定库文件路径,`-l` 选项用于指定需要链接的库文件名。下面是这个命令中的各个选项的含义: - `-I../libavformat`: 指定了 FFmpeg 中 `libavformat` 库的头文件路径。 - `-I../libavcodec`: 指定了 FFmpeg 中 `libavcodec` 库的头文件路径。 - `-I../libavutil`: 指定了 FFmpeg 中 `libavutil` 库的头文件路径。 - `-I../libswresample`: 指定了 FFmpeg 中 `libswresample` 库的头文件路径。 - `-I../libswscale`: 指定了 FFmpeg 中 `libswscale` 库的头文件路径。 - `-I../libavfilter`: 指定了 FFmpeg 中 `libavfilter` 库的头文件路径。 - `-L../libavcodec`: 指定了 FFmpeg 中 `libavcodec` 库的库文件路径。 - `-L../libavformat`: 指定了 FFmpeg 中 `libavformat` 库的库文件路径。 - `-L../libavutil`: 指定了 FFmpeg 中 `libavutil` 库的库文件路径。 - `-L../libswresample`: 指定了 FFmpeg 中 `libswresample` 库的库文件路径。 - `-L../libswscale`: 指定了 FFmpeg 中 `libswscale` 库的库文件路径。 - `-L../libavfilter`: 指定了 FFmpeg 中 `libavfilter` 库的库文件路径。 - `-lavformat`: 指定了需要链接的 FFmpeg 中 `libavformat` 库的名称。 - `-lavcodec`: 指定了需要链接的 FFmpeg 中 `libavcodec` 库的名称。 - `-lswresample`: 指定了需要链接的 FFmpeg 中 `libswresample` 库的名称。 - `-lswscale`: 指定了需要链接的 FFmpeg 中 `libswscale` 库的名称。 - `-lavutil`: 指定了需要链接的 FFmpeg 中 `libavutil` 库的名称。 - `-lavfilter`: 指定了需要链接的 FFmpeg 中 `libavfilter` 库的名称。 - `-lm`: 指定需要链接的数学库。 - `-lz`: 指定需要链接的压缩库。 - `-pthread`: 指定需要链接的线程库。 - `-lSDL2`: 指定需要链接的 SDL2 库的名称。 这个命令的作用是将 `ffplay.c` 编译成可执行文件 `ffplay`,并链接上 FFmpeg 和 SDL 库。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值