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 */
th>parentaf8c34ce6ae32addda3788d54a7e340cad22516b (diff)parent665f05e0b836d46b22f0b712eb76d8b7f69a5ea0 (diff)
Merge tag 'edac_fixes_for_4.7' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp
Pull EDAC fixes from Borislav Petkov: "EDAC fixes to recent fallout from workqueue cleanup and Broadwell enablement: - sb_edac fallout fixes from recent Broadwell enablement (Tony Luck) - EDAC workqueue poll period resetting fix (Nicholas Krause)" * tag 'edac_fixes_for_4.7' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp: EDAC, sb_edac: Readd accidentally dropped Broadwell-D support EDAC: Fix workqueues poll period resetting EDAC, sb_edac: Fix rank lookup on Broadwell
Diffstat