mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-28 21:28:21 +00:00
topology: system cpu topology
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
#ifndef _TOPOLOGY_H
|
||||
#define _TOPOLOGY_H
|
||||
|
||||
#define TOPOLOGY_MAKE_ID(depth, id) ((depth << 16) | id)
|
||||
|
||||
#include <arch/cpu.h>
|
||||
|
||||
typedef struct topology_node_t {
|
||||
int id;
|
||||
struct topology_node_t *parent;
|
||||
struct topology_node_t *sibling;
|
||||
struct topology_node_t *children;
|
||||
cpu_t *cpu;
|
||||
} topology_node_t;
|
||||
|
||||
extern topology_node_t topology_root;
|
||||
|
||||
topology_node_t *topology_create_node(void);
|
||||
void topology_insert(topology_node_t *node, topology_node_t *parent, int id, cpu_t *cpu);
|
||||
|
||||
static inline topology_node_t *topology_get_root(void) {
|
||||
return &topology_root;
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user