Clarify a few comments.
In particular, one TODO that is unlikely ever to be addressed in the
suggested direction.
Change-Id: I812e08d81c0db67e779f90904675f44eefe09312
diff --git a/src/globals.h b/src/globals.h
index 0cf4260..4ec6dcb 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -43,19 +43,14 @@
// Required object alignment
const int kObjectAlignment = 8;
-// Required ARM instruction alignment
+// ARM instruction alignment. ARM processors require code to be 4-byte aligned.
const int kArmAlignment = 4;
-// Required X86 instruction alignment
+// X86 instruction alignment. This is the recommended alignment for maximum performance.
const int kX86Alignment = 16;
-// System page size. Normally you're expected to get this from
-// sysconf(_SC_PAGESIZE) or some system-specific define (usually
-// PAGESIZE or PAGE_SIZE). If we use a simple compile-time constant
-// the compiler can generate appropriate masks directly, so we define
-// it here and verify it as the runtime is starting up.
-//
-// Must be a power of 2.
+// System page size. We check this against sysconf(_SC_PAGE_SIZE) at runtime, but use a simple
+// compile-time constant so the compiler can generate better code.
const int kPageSize = 4096;
} // namespace art
diff --git a/src/thread_x86.cc b/src/thread_x86.cc
index 30caaec..73b0465 100644
--- a/src/thread_x86.cc
+++ b/src/thread_x86.cc
@@ -30,11 +30,6 @@
#include <asm/ldt.h>
#endif
-// TODO: add SYS_modify_ldt definition to bionic
-#ifndef SYS_modify_ldt
-#define SYS_modify_ldt __NR_modify_ldt
-#endif
-
namespace art {
void Thread::InitCpu() {
@@ -49,7 +44,7 @@
std::vector<uint64_t> ldt(LDT_ENTRIES);
size_t ldt_size(sizeof(uint64_t) * ldt.size());
memset(&ldt[0], 0, ldt_size);
- syscall(SYS_modify_ldt, 0, &ldt[0], ldt_size);
+ syscall(__NR_modify_ldt, 0, &ldt[0], ldt_size);
// Create empty slot to point at current Thread*
user_desc ldt_entry;
memset(&ldt_entry, 0, sizeof(ldt_entry));
@@ -72,7 +67,7 @@
LOG(FATAL) << "Failed to find available LDT slot";
}
// Update LDT
- CHECK_EQ(0, syscall(SYS_modify_ldt, 1, &ldt_entry, sizeof(ldt_entry)));
+ CHECK_EQ(0, syscall(__NR_modify_ldt, 1, &ldt_entry, sizeof(ldt_entry)));
// Change FS to be new LDT entry
uint16_t table_indicator = 1 << 2; // LDT
uint16_t rpl = 3; // Requested privilege level