Re: [PATCH] kernel32: implement GetLargePageMinimum
Marcus Meissner <marcus(a)jet.franken.de> writes:
+SIZE_T WINAPI GetLargePageMinimum(void) +{ +#ifdef linux + FILE *f; + unsigned long hugepagesize = 0; + + f = fopen( "/proc/meminfo", "r" ); + if (f) + { + char buffer[256]; + + while (fgets( buffer, sizeof(buffer), f )) + { + if (sscanf( buffer, "Hugepagesize: %lu", &hugepagesize )) + break; + } + fclose( f ); + } + return (SIZE_T)hugepagesize*1024; +#else + FIXME("stub: not implemented on your platform.\n"); + return 0; +#endif
This could probably be simply hard-coded based on the CPU architecture. -- Alexandre Julliard julliard(a)winehq.org
On Mon, Jun 13, 2016 at 08:28:18PM +0900, Alexandre Julliard wrote:
Marcus Meissner <marcus(a)jet.franken.de> writes:
+SIZE_T WINAPI GetLargePageMinimum(void) +{ +#ifdef linux + FILE *f; + unsigned long hugepagesize = 0; + + f = fopen( "/proc/meminfo", "r" ); + if (f) + { + char buffer[256]; + + while (fgets( buffer, sizeof(buffer), f )) + { + if (sscanf( buffer, "Hugepagesize: %lu", &hugepagesize )) + break; + } + fclose( f ); + } + return (SIZE_T)hugepagesize*1024; +#else + FIXME("stub: not implemented on your platform.\n"); + return 0; +#endif
This could probably be simply hard-coded based on the CPU architecture.
While it does depend on some processor flags and also kernel support, I think these are default enabled everywhere, so we can just hardcode it. I sent a follow up patch. Ciao, Marcus
participants (2)
-
Alexandre Julliard -
Marcus Meissner