33 // Information about the protection of the page at address '0' on this os. |
33 // Information about the protection of the page at address '0' on this os. |
34 static bool zero_page_read_protected() { return true; } |
34 static bool zero_page_read_protected() { return true; } |
35 |
35 |
36 class Linux { |
36 class Linux { |
37 friend class os; |
37 friend class os; |
|
38 friend class OSContainer; |
38 friend class TestReserveMemorySpecial; |
39 friend class TestReserveMemorySpecial; |
39 |
40 |
40 // For signal-chaining |
41 // For signal-chaining |
41 #define MAXSIGNUM 32 |
42 #define MAXSIGNUM 32 |
42 static struct sigaction sigact[MAXSIGNUM]; // saved preinstalled sigactions |
43 static struct sigaction sigact[MAXSIGNUM]; // saved preinstalled sigactions |
77 static int _page_size; |
78 static int _page_size; |
78 static const int _vm_default_page_size; |
79 static const int _vm_default_page_size; |
79 |
80 |
80 static julong available_memory(); |
81 static julong available_memory(); |
81 static julong physical_memory() { return _physical_memory; } |
82 static julong physical_memory() { return _physical_memory; } |
|
83 static void set_physical_memory(julong phys_mem) { _physical_memory = phys_mem; } |
|
84 static int active_processor_count(); |
|
85 |
82 static void initialize_system_info(); |
86 static void initialize_system_info(); |
83 |
87 |
84 static int commit_memory_impl(char* addr, size_t bytes, bool exec); |
88 static int commit_memory_impl(char* addr, size_t bytes, bool exec); |
85 static int commit_memory_impl(char* addr, size_t bytes, |
89 static int commit_memory_impl(char* addr, size_t bytes, |
86 size_t alignment_hint, bool exec); |
90 size_t alignment_hint, bool exec); |
114 static bool release_memory_special_impl(char* base, size_t bytes); |
118 static bool release_memory_special_impl(char* base, size_t bytes); |
115 static bool release_memory_special_shm(char* base, size_t bytes); |
119 static bool release_memory_special_shm(char* base, size_t bytes); |
116 static bool release_memory_special_huge_tlbfs(char* base, size_t bytes); |
120 static bool release_memory_special_huge_tlbfs(char* base, size_t bytes); |
117 |
121 |
118 static void print_full_memory_info(outputStream* st); |
122 static void print_full_memory_info(outputStream* st); |
|
123 static void print_container_info(outputStream* st); |
119 static void print_distro_info(outputStream* st); |
124 static void print_distro_info(outputStream* st); |
120 static void print_libversion_info(outputStream* st); |
125 static void print_libversion_info(outputStream* st); |
121 |
126 |
122 public: |
127 public: |
123 static bool _stack_is_executable; |
128 static bool _stack_is_executable; |