Исправление запуска модулей на Astra Linux

This commit is contained in:
Aren Elchinyan 2023-11-13 22:54:24 +03:00
parent d7d41481b8
commit b0c33f7f2e
4 changed files with 16 additions and 15 deletions

View File

@ -1,3 +1,3 @@
#define VERSION_MAJOR 0 #define VERSION_MAJOR 0
#define VERSION_MINOR 1 #define VERSION_MINOR 1
#define VERSION_BUILD 502 #define VERSION_BUILD 505

View File

@ -9,7 +9,7 @@ static inline void cpuid(uint32_t leaf, uint32_t *eax, uint32_t *ebx,
: "a"(leaf)); : "a"(leaf));
} }
static void L1_cache_size( ) { static inline void L1_cache_size( ) {
uint32_t eax, ebx, ecx, edx; uint32_t eax, ebx, ecx, edx;
cpuid(0x80000006, &eax, &ebx, &ecx, &edx); cpuid(0x80000006, &eax, &ebx, &ecx, &edx);
if ((edx & 0xFF) == 0) { if ((edx & 0xFF) == 0) {
@ -21,7 +21,7 @@ static void L1_cache_size( ) {
ecx & 0xff, (ecx >> 12) & 0x07, (ecx >> 16) & 0xffff); ecx & 0xff, (ecx >> 12) & 0x07, (ecx >> 16) & 0xffff);
} }
static void L2_cache_size( ) { static inline void L2_cache_size( ) {
uint32_t eax, ebx, ecx, edx; uint32_t eax, ebx, ecx, edx;
cpuid(0x80000006, &eax, &ebx, &ecx, &edx); cpuid(0x80000006, &eax, &ebx, &ecx, &edx);
if ((edx & 0xFF) == 0) { if ((edx & 0xFF) == 0) {
@ -33,7 +33,7 @@ static void L2_cache_size( ) {
ecx & 0xff, (ecx >> 12) & 0x0F, (ecx >> 16) & 0xFFFF); ecx & 0xff, (ecx >> 12) & 0x0F, (ecx >> 16) & 0xFFFF);
} }
static void L3_cache_size( ) { static inline void L3_cache_size( ) {
uint32_t eax, ebx, ecx, edx; uint32_t eax, ebx, ecx, edx;
cpuid(0x80000006, &eax, &ebx, &ecx, &edx); cpuid(0x80000006, &eax, &ebx, &ecx, &edx);
if ((edx & 0xFF) == 0) { if ((edx & 0xFF) == 0) {

View File

@ -15,7 +15,7 @@ static inline void outl(uint16_t port, uint32_t data) {
asm volatile("outl %0, %1" : : "a"(data), "Nd"(port)); asm volatile("outl %0, %1" : : "a"(data), "Nd"(port));
} }
static uint16_t pci_read_word(uint16_t bus, uint16_t slot, uint16_t func, static inline uint16_t pci_read_word(uint16_t bus, uint16_t slot, uint16_t func,
uint16_t offset) { uint16_t offset) {
uint64_t address; uint64_t address;
uint64_t lbus = (uint64_t)bus; uint64_t lbus = (uint64_t)bus;
@ -29,30 +29,31 @@ static uint16_t pci_read_word(uint16_t bus, uint16_t slot, uint16_t func,
return (tmp); return (tmp);
} }
static uint16_t get_vendor_id(uint16_t bus, uint16_t device, static inline uint16_t get_vendor_id(uint16_t bus, uint16_t device,
uint16_t function) { uint16_t function) {
uint32_t r0 = pci_read_word(bus, device, function, 0); uint32_t r0 = pci_read_word(bus, device, function, 0);
return r0; return r0;
} }
static uint16_t get_device_id(uint16_t bus, uint16_t device, static inline uint16_t get_device_id(uint16_t bus, uint16_t device,
uint16_t function) { uint16_t function) {
uint32_t r0 = pci_read_word(bus, device, function, 2); uint32_t r0 = pci_read_word(bus, device, function, 2);
return r0; return r0;
} }
static uint16_t get_class_id(uint16_t bus, uint16_t device, uint16_t function) { static inline uint16_t get_class_id(uint16_t bus, uint16_t device,
uint16_t function) {
uint32_t r0 = pci_read_word(bus, device, function, 0xA); uint32_t r0 = pci_read_word(bus, device, function, 0xA);
return (r0 & ~0x00FF) >> 8; return (r0 & ~0x00FF) >> 8;
} }
static uint16_t get_sub_class_id(uint16_t bus, uint16_t device, static inline uint16_t get_sub_class_id(uint16_t bus, uint16_t device,
uint16_t function) { uint16_t function) {
uint32_t r0 = pci_read_word(bus, device, function, 0xA); uint32_t r0 = pci_read_word(bus, device, function, 0xA);
return (r0 & ~0xFF00); return (r0 & ~0xFF00);
} }
static void scan( ) { static inline void scan( ) {
uint64_t devices = 0; uint64_t devices = 0;
for (uint32_t bus = 0; bus < 256; bus++) { for (uint32_t bus = 0; bus < 256; bus++) {
for (uint32_t slot = 0; slot < 32; slot++) { for (uint32_t slot = 0; slot < 32; slot++) {