gpt4 book ai didi

linux-kernel - Android (Linux) 内核 'HZ' 变量

转载 作者:行者123 更新时间:2023-12-04 04:58:23 25 4
gpt4 key购买 nike

我目前正在研究 WiFI 的内核源代码(net/mac80211)
(三星Galaxy S3---GT-I9300---内核)

我已经看到了如下代码:

/*
* Scanning implementation
*
* Copyright 2003, Jouni Malinen <jkmaline@cc.hut.fi>
* Copyright 2004, Instant802 Networks, Inc.
* Copyright 2005, Devicescape Software, Inc.
* Copyright 2006-2007 Jiri Benc <jbenc@suse.cz>
* Copyright 2007, Michael Wu <flamingice@sourmilk.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/

#include <linux/if_arp.h>
#include <linux/rtnetlink.h>
#include <linux/pm_qos_params.h>
#include <net/sch_generic.h>
#include <linux/slab.h>
#include <net/mac80211.h>

#include "ieee80211_i.h"
#include "driver-ops.h"
#include "mesh.h"

#define IEEE80211_PROBE_DELAY (HZ / 33)
#define IEEE80211_CHANNEL_TIME (HZ / 33)
#define IEEE80211_PASSIVE_CHANNEL_TIME (HZ / 8)

在代码的底部,它定义了关于变量“HZ”的 PROBE_DELAY、CHANNEL_TIME、PASSIVE_CHANNEL_TIME

因此,我输入了 grep -r "HZ" ./ >> ~/grep_result找到 HZ 的定义位置。

但是,结果,没有定义,HZ 的声明。

我在哪里可以找到 HZ 的确切值?

如果我找到 HZ 值,单位是什么?

最佳答案

HZ 通常定义为 CONFIG_HZ . CONFIG_HZ 在 make config 期间定义。过程

通用定义在

include/asm-generic/param.h;



架构特定的定义在

arch//include/asm/param.h



倾向于简单地将其定义为 CONFIG_HZ以及;请注意,您可能会在

arch//include/asm/uapi/param.h



内核不使用这些 HZ 定义,它们是用户空间 API 接口(interface)值;

希望这可以帮助。

关于linux-kernel - Android (Linux) 内核 'HZ' 变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16455167/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com