File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 11#include "swap.h"
22
33#include <OS.h>
4+ #include <driver_settings.h>
45
5- const char * ffDetectSwap (FFSwapResult * swap )
6+ const char * ffDetectSwap (FFlist * result )
67{
78 system_info info ;
89 if (get_system_info (& info ) != B_OK )
910 return "Error getting system info" ;
1011
1112 uint32_t pageSize = instance .state .platform .sysinfo .pageSize ;
13+ FFSwapResult * swap = ffListAdd (result );
14+ ffStrbufInitStatic (& swap -> name , "System" );
15+ void * kvms = load_driver_settings ("virtual_memory" ); // /boot/home/config/settings/kernel/drivers/virtual_memory
16+ if (kvms )
17+ {
18+ const char * swapAuto = get_driver_parameter (kvms , "swap_auto" , NULL , NULL );
19+ if (swapAuto )
20+ ffStrbufSetStatic (& swap -> name , swapAuto [0 ] == 'y' ? "Auto" : "Manual" );
21+ unload_driver_settings (kvms );
22+ }
1223 swap -> bytesTotal = pageSize * (uint64_t ) info .max_swap_pages ;
1324 swap -> bytesUsed = pageSize * (uint64_t ) (info .max_swap_pages - info .free_swap_pages );
1425
You can’t perform that action at this time.
0 commit comments