types.h 1.24 KB
Newer Older
arjanvandeven's avatar
arjanvandeven committed
1 2 3 4 5 6 7 8 9 10 11 12
#ifndef _INCLUDE_GUARD_TYPES_H
#define _INCLUDE_GUARD_TYPES_H

#include <glib.h>

#include "cpumask.h"

#define	BALANCE_NONE		0
#define BALANCE_PACKAGE 	1
#define BALANCE_CACHE		2
#define BALANCE_CORE		3

13 14 15
/*
 * IRQ Classes
 */
16
#define IRQ_NODEF	-1
arjanvandeven's avatar
arjanvandeven committed
17 18 19
#define IRQ_OTHER       0
#define IRQ_LEGACY      1
#define IRQ_SCSI        2
20
#define IRQ_VIDEO       3
arjanvandeven's avatar
arjanvandeven committed
21
#define IRQ_ETH         4
22 23 24
#define IRQ_GBETH       5
#define IRQ_10GBETH     6
#define IRQ_VIRT_EVENT  7
arjanvandeven's avatar
arjanvandeven committed
25

26 27 28
/*
 * IRQ Types
 */
29 30 31 32
#define IRQ_TYPE_LEGACY     0
#define IRQ_TYPE_MSI        1
#define IRQ_TYPE_MSIX       2
#define IRQ_TYPE_VIRT_EVENT 3
33

34 35 36 37 38
/*
 * IRQ Internal tracking flags
 */
#define IRQ_FLAG_BANNED	1

39 40 41 42 43 44 45
enum obj_type_e {
	OBJ_TYPE_CPU,
	OBJ_TYPE_CACHE,
	OBJ_TYPE_PACKAGE,
	OBJ_TYPE_NODE
};

46
struct topo_obj {
47
	uint64_t load;
Neil Horman's avatar
Neil Horman committed
48
	uint64_t last_load;
49
	uint64_t irq_count;
50
	enum obj_type_e obj_type;
51
	int number;
Neil Horman's avatar
Neil Horman committed
52
	int powersave_mode;
53 54
	cpumask_t mask;
	GList *interrupts;
55
	struct topo_obj *parent;
56
	GList *children;
57
	GList *numa_nodes;
58
	GList **obj_type_list;
arjanvandeven's avatar
arjanvandeven committed
59 60
};

61
struct irq_info {
62 63 64
	int irq;
	int class;
	int type;
65
	int level;
66
	int flags;
67 68 69 70
	struct topo_obj *numa_node;
	cpumask_t cpumask;
	uint64_t irq_count;
	uint64_t last_irq_count;
71
	uint64_t load;
72
	int moved;
73 74
	struct topo_obj *assigned_obj;
	char *name;
arjanvandeven's avatar
arjanvandeven committed
75 76 77
};

#endif