summaryrefslogtreecommitdiff
path: root/cpus.h
blob: 062672677d73b72319e93f546a8c70f3899c7ad4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef CPUS_H
#define CPUS_H

#include <unistd.h>
#include "built_in.h"
#include "die.h"

static inline unsigned int get_number_cpus(void)
{
	int ret = sysconf(_SC_NPROCESSORS_CONF);

	if (unlikely(ret <= 0))
		panic("get_number_cpus error!\n");

	return ret;
}

static inline unsigned int get_number_cpus_online(void)
{
	int ret = sysconf(_SC_NPROCESSORS_ONLN);

	if (unlikely(ret <= 0))
		panic("get_number_cpus_online error!\n");

	return ret;
}

#endif /* CPUS_H */
o' class='commit-info'> authorDavid S. Miller <davem@davemloft.net>2017-02-02 16:54:00 -0500 committerDavid S. Miller <davem@davemloft.net>2017-02-02 16:54:00 -0500 commite2160156bf2a7d5018e99a9993fbcdda0abac09b (patch) tree1a70cb13dcfa7ade4c48d8a64d20543abebfb1dc /drivers/usb/musb/Kconfig parent62e13097c46c69dbd7544ab2cd585ccf48f360a4 (diff)parent6d04dfc8966019b8b0977b2cb942351f13d2b178 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
All merge conflicts were simple overlapping changes. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/usb/musb/Kconfig')