mirror of
https://github.com/rdmsr/zag.git
synced 2026-10-27 13:58:20 +00:00
feat(amd64): add PGE to cpuid
This commit is contained in:
@@ -320,6 +320,7 @@ pub const CpuFeatures = struct {
|
||||
pcid: bool,
|
||||
smap: bool,
|
||||
smep: bool,
|
||||
pge: bool,
|
||||
vendor_string: [12]u8,
|
||||
brand_string: [48]u8,
|
||||
};
|
||||
@@ -343,6 +344,7 @@ pub fn detect_cpu_features() void {
|
||||
var pcid = false;
|
||||
var smap = false;
|
||||
var smep = false;
|
||||
var pge = false;
|
||||
|
||||
var vendor_string: [12]u8 = undefined;
|
||||
var brand_string: [48]u8 = undefined;
|
||||
@@ -361,6 +363,7 @@ pub fn detect_cpu_features() void {
|
||||
xsave = ecx.xsave;
|
||||
pcid = ecx.pcid;
|
||||
fxsave = edx.fxsave;
|
||||
pge = edx.pge;
|
||||
}
|
||||
|
||||
if (max_basic >= 0x7) {
|
||||
@@ -416,5 +419,6 @@ pub fn detect_cpu_features() void {
|
||||
.smep = smep,
|
||||
.vendor_string = vendor_string,
|
||||
.brand_string = brand_string,
|
||||
.pge = pge,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ pub const name = "amd64";
|
||||
|
||||
const com1 = 0x3F8;
|
||||
|
||||
fn com1_init() void {
|
||||
fn com1_init() linksection(b.init) void {
|
||||
cpu.outb(com1 + 0x3, 0x80);
|
||||
cpu.outb(com1 + 0x0, 0x0c);
|
||||
cpu.outb(com1 + 0x1, 0x00);
|
||||
@@ -44,12 +44,13 @@ pub fn early_init() linksection(b.init) void {
|
||||
const f = cpu.cpu_features;
|
||||
|
||||
std.log.info("amd64/cpu: {s}", .{&f.brand_string});
|
||||
std.log.info("amd64/cpu: vendor={s} x2apic={} la57={} nx={} pcid={} smap={} smep={} pdpe1g={} invtsc={} xsave={} fxsave={} tsc-deadline={}", .{
|
||||
std.log.info("amd64/cpu: vendor={s} x2apic={} la57={} nx={} pcid={} pge={} smap={} smep={} pdpe1g={} invtsc={} xsave={} fxsave={} tsc-deadline={}", .{
|
||||
&f.vendor_string,
|
||||
@intFromBool(f.x2apic),
|
||||
@intFromBool(f.five_level_paging),
|
||||
@intFromBool(f.nx),
|
||||
@intFromBool(f.pcid),
|
||||
@intFromBool(f.pge),
|
||||
@intFromBool(f.smap),
|
||||
@intFromBool(f.smep),
|
||||
@intFromBool(f.gib_pages),
|
||||
|
||||
Reference in New Issue
Block a user