Files
SUB-OS/include/drivers/cpufreq.h
T
subhobhai943 492045b24d feat: Add Intel e1000e PCIe NIC, VirtIO-GPU 2D accelerator, CPUFreq governor, and VirtIO-Input drivers
- Implement Intel 82574L / 82567LM / I217 / I219 PCIe Gigabit NIC driver with DMA ring buffers and auto-negotiation in drivers/net/e1000e.c and include/drivers/e1000e.h
- Implement VirtIO-GPU 2D hardware graphics display adapter driver with dirty rect flushing in drivers/virtio/virtio_gpu.c and include/drivers/virtio_gpu.h
- Implement Dynamic CPU Frequency Scaling and ACPI CPPC Power Governor with performance, powersave, ondemand, conservative, and schedutil policies in drivers/power/cpufreq.c and include/drivers/cpufreq.h
- Implement VirtIO-Input para-virtualized tablet/mouse event driver in drivers/virtio/virtio_input.c and include/drivers/virtio_input.h
- Expand stage2 kernel bootloader loading boundary to 768 KB (1536 sectors)
- Add LazyBox applets: 'cpufreq', 'gpuinfo', 'e1000e'
- Verified across x86_64, AArch64, and ARMv8i targets
2026-08-21 02:38:27 +05:30

33 lines
794 B
C

#ifndef _DRIVERS_CPUFREQ_H
#define _DRIVERS_CPUFREQ_H
#include <stdint.h>
#include <stdbool.h>
typedef enum {
CPUFREQ_GOV_PERFORMANCE,
CPUFREQ_GOV_POWERSAVE,
CPUFREQ_GOV_ONDEMAND,
CPUFREQ_GOV_CONSERVATIVE,
CPUFREQ_GOV_SCHEDUTIL,
} cpufreq_gov_type_t;
typedef struct {
uint32_t current_khz;
uint32_t min_khz;
uint32_t max_khz;
uint32_t voltage_mv;
cpufreq_gov_type_t governor;
uint64_t transitions;
} cpufreq_stats_t;
void cpufreq_init(void);
int cpufreq_set_governor(cpufreq_gov_type_t gov);
int cpufreq_set_governor_by_name(const char* name);
int cpufreq_set_frequency(uint32_t target_khz);
cpufreq_stats_t cpufreq_get_stats(void);
void cpufreq_update_load(uint32_t cpu_load_percent);
void cpufreq_dump_info(void);
#endif // _DRIVERS_CPUFREQ_H