replace nob with ms' build, move disk creation to build.bat, major comment cleanup, remove old and stupid tests, overhaul interrupt management with per-CPU vector allocation, affinity migration and safe teardown, add proper IOAPIC routing and PCI MSI/MSI-X/INTx support, migrate drivers to the new interrupt API, integrate ACPICA with a proper OS services layer, move ACPI firmware events, power button handling and S5 shutdown into acpi.sys, add parallel driver startup and atomic publication, replace PnP arrays with dynamic lists, redesign service startup again to be asynchronous, add delayed startup mode for services, allow omitting keys in services.ini, fix acpi ec deferred work handling, fix kernel threads having garbage exit code.
This commit is contained in:
1 parent
d36f19509c
commit
36eef8f58d
696 files changed
+147281
-7530
No files matched your search
@@ -9,12 +9,10 @@
|
||||
#include "posix_internal.h"
|
||||
#include "posix_fd.h"
|
||||
|
||||
// Implements the bswap16 operation.
|
||||
static uint16_t bswap16(uint16_t x) {
|
||||
return (uint16_t)((x << 8) | (x >> 8));
|
||||
}
|
||||
|
||||
// Implements the bswap32 operation.
|
||||
static uint32_t bswap32(uint32_t x) {
|
||||
return ((x & 0x000000FFu) << 24) |
|
||||
((x & 0x0000FF00u) << 8) |
|
||||
@@ -22,13 +20,9 @@ static uint32_t bswap32(uint32_t x) {
|
||||
((x & 0xFF000000u) >> 24);
|
||||
}
|
||||
|
||||
// Implements the htons operation.
|
||||
__declspec(dllexport) uint16_t htons(uint16_t x) { return bswap16(x); }
|
||||
// Implements the ntohs operation.
|
||||
__declspec(dllexport) uint16_t ntohs(uint16_t x) { return bswap16(x); }
|
||||
// Implements the htonl operation.
|
||||
__declspec(dllexport) uint32_t htonl(uint32_t x) { return bswap32(x); }
|
||||
// Implements the ntohl operation.
|
||||
__declspec(dllexport) uint32_t ntohl(uint32_t x) { return bswap32(x); }
|
||||
|
||||
// Parses byte.
|
||||
@@ -148,7 +142,6 @@ static char* AppendHex16(char* out, uint16_t value) {
|
||||
return out;
|
||||
}
|
||||
|
||||
// Implements the inet addr operation.
|
||||
__declspec(dllexport) in_addr_t inet_addr(const char* text) {
|
||||
uint8_t b[4];
|
||||
if (!text || !ParseIpv4Bytes(text, b)) return INADDR_NONE;
|
||||
@@ -158,7 +151,6 @@ __declspec(dllexport) in_addr_t inet_addr(const char* text) {
|
||||
return out;
|
||||
}
|
||||
|
||||
// Implements the inet ntoa operation.
|
||||
__declspec(dllexport) char* inet_ntoa(struct in_addr in) {
|
||||
static char buf[16];
|
||||
const uint8_t* p = (const uint8_t*)&in.s_addr;
|
||||
@@ -175,7 +167,6 @@ __declspec(dllexport) char* inet_ntoa(struct in_addr in) {
|
||||
return buf;
|
||||
}
|
||||
|
||||
// Implements the inet pton operation.
|
||||
__declspec(dllexport) int inet_pton(int af, const char* src, void* dst) {
|
||||
if (!src || !dst) { errno = EINVAL; return -1; }
|
||||
if (af == AF_INET) {
|
||||
@@ -196,7 +187,6 @@ __declspec(dllexport) int inet_pton(int af, const char* src, void* dst) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Implements the inet ntop operation.
|
||||
__declspec(dllexport) const char* inet_ntop(int af, const void* src, char* dst, socklen_t size) {
|
||||
if (!src || !dst) { errno = EINVAL; return (const char*)0; }
|
||||
if (af == AF_INET) {
|
||||
@@ -223,7 +213,6 @@ __declspec(dllexport) const char* inet_ntop(int af, const void* src, char* dst,
|
||||
return (const char*)0;
|
||||
}
|
||||
|
||||
// Implements the sock Addr To Sys operation.
|
||||
static int SockAddrToSys(const struct sockaddr* addr, socklen_t addrlen, SYS_SOCKET_ADDRESS* out) {
|
||||
if (!addr || !out) { errno = EINVAL; return -1; }
|
||||
memset(out, 0, sizeof(*out));
|
||||
@@ -252,7 +241,6 @@ static int SockAddrToSys(const struct sockaddr* addr, socklen_t addrlen, SYS_SOC
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Implements the to Sock Addr operation.
|
||||
static void SysToSockAddr(const SYS_SOCKET_ADDRESS* in, struct sockaddr* addr, socklen_t* addrlen) {
|
||||
if (!in || !addr || !addrlen) return;
|
||||
|
||||
@@ -691,7 +679,6 @@ static unsigned ParsePort(const char* s) {
|
||||
return *s == '\0' ? v : 0;
|
||||
}
|
||||
|
||||
// Implements the resolve Name operation.
|
||||
static int ResolveNameFamily(const char* name, int family, SYS_SOCKET_ADDRESS* out) {
|
||||
if (!name || !out) { errno = EINVAL; return -1; }
|
||||
memset(out, 0, sizeof(*out));
|
||||
@@ -739,7 +726,6 @@ static int ResolveNameAny(const char* name, int family, SYS_SOCKET_ADDRESS* out)
|
||||
return ResolveNameFamily(name, AF_INET, out);
|
||||
}
|
||||
|
||||
// Implements the gethostbyname operation.
|
||||
__declspec(dllexport) struct hostent* gethostbyname(const char* name) {
|
||||
static struct hostent h;
|
||||
static char hname[256];
|
||||
@@ -804,7 +790,6 @@ __declspec(dllexport) int getaddrinfo(const char* node, const char* service,
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Implements the freeaddrinfo operation.
|
||||
__declspec(dllexport) void freeaddrinfo(struct addrinfo* res) {
|
||||
if (res) free(res);
|
||||
}
|
||||
Reference in new issue
Block a user