69 #include "base/basictypes.h" |
70 #include "base/basictypes.h" |
70 #include "base/logging.h" |
71 #include "base/logging.h" |
71 |
72 |
72 namespace base { |
73 namespace base { |
73 |
74 |
|
75 diff --git a/layout/base/tests/TestPoisonArea.cpp b/layout/base/tests/TestPoisonArea.cpp |
|
76 --- a/layout/base/tests/TestPoisonArea.cpp |
|
77 +++ b/layout/base/tests/TestPoisonArea.cpp |
|
78 @@ -392,53 +392,53 @@ ReservePoisonArea() |
|
79 { |
|
80 if (sizeof(uintptr_t) == 8) { |
|
81 // Use the hardware-inaccessible region. |
|
82 // We have to avoid 64-bit constants and shifts by 32 bits, since this |
|
83 // code is compiled in 32-bit mode, although it is never executed there. |
|
84 uintptr_t result = (((uintptr_t(0x7FFFFFFFu) << 31) << 1 | |
|
85 uintptr_t(0xF0DEAFFFu)) & |
|
86 ~uintptr_t(PAGESIZE-1)); |
|
87 - printf("INFO | poison area assumed at 0x%.*"PRIxPTR"\n", SIZxPTR, result); |
|
88 + printf("INFO | poison area assumed at 0x%.*" PRIxPTR "\n", SIZxPTR, result); |
|
89 return result; |
|
90 } else { |
|
91 // First see if we can allocate the preferred poison address from the OS. |
|
92 uintptr_t candidate = (0xF0DEAFFF & ~(PAGESIZE-1)); |
|
93 void *result = ReserveRegion(candidate, false); |
|
94 if (result == (void *)candidate) { |
|
95 // success - inaccessible page allocated |
|
96 - printf("INFO | poison area allocated at 0x%.*"PRIxPTR |
|
97 + printf("INFO | poison area allocated at 0x%.*" PRIxPTR |
|
98 " (preferred addr)\n", SIZxPTR, (uintptr_t)result); |
|
99 return candidate; |
|
100 } |
|
101 |
|
102 // That didn't work, so see if the preferred address is within a range |
|
103 // of permanently inacessible memory. |
|
104 if (ProbeRegion(candidate)) { |
|
105 // success - selected page cannot be usable memory |
|
106 if (result != MAP_FAILED) |
|
107 ReleaseRegion(result); |
|
108 - printf("INFO | poison area assumed at 0x%.*"PRIxPTR |
|
109 + printf("INFO | poison area assumed at 0x%.*" PRIxPTR |
|
110 " (preferred addr)\n", SIZxPTR, candidate); |
|
111 return candidate; |
|
112 } |
|
113 |
|
114 // The preferred address is already in use. Did the OS give us a |
|
115 // consolation prize? |
|
116 if (result != MAP_FAILED) { |
|
117 - printf("INFO | poison area allocated at 0x%.*"PRIxPTR |
|
118 + printf("INFO | poison area allocated at 0x%.*" PRIxPTR |
|
119 " (consolation prize)\n", SIZxPTR, (uintptr_t)result); |
|
120 return (uintptr_t)result; |
|
121 } |
|
122 |
|
123 // It didn't, so try to allocate again, without any constraint on |
|
124 // the address. |
|
125 result = ReserveRegion(0, false); |
|
126 if (result != MAP_FAILED) { |
|
127 - printf("INFO | poison area allocated at 0x%.*"PRIxPTR |
|
128 + printf("INFO | poison area allocated at 0x%.*" PRIxPTR |
|
129 " (fallback)\n", SIZxPTR, (uintptr_t)result); |
|
130 return (uintptr_t)result; |
|
131 } |
|
132 |
|
133 printf("ERROR | no usable poison area found\n"); |
|
134 return 0; |
|
135 } |
|
136 } |
|
137 @@ -450,17 +450,17 @@ static uintptr_t |
|
138 ReservePositiveControl() |
|
139 { |
|
140 |
|
141 void *result = ReserveRegion(0, false); |
|
142 if (result == MAP_FAILED) { |
|
143 printf("ERROR | allocating positive control | %s\n", LastErrMsg()); |
|
144 return 0; |
|
145 } |
|
146 - printf("INFO | positive control allocated at 0x%.*"PRIxPTR"\n", |
|
147 + printf("INFO | positive control allocated at 0x%.*" PRIxPTR "\n", |
|
148 SIZxPTR, (uintptr_t)result); |
|
149 return (uintptr_t)result; |
|
150 } |
|
151 |
|
152 /* The "negative control" area confirms that our probe logic does detect a |
|
153 * page that is readable, writable, or executable. |
|
154 */ |
|
155 static uintptr_t |
|
156 @@ -481,17 +481,17 @@ ReserveNegativeControl() |
|
157 // Now mark it executable as well as readable and writable. |
|
158 // (mmap(PROT_EXEC) may fail when applied to anonymous memory.) |
|
159 |
|
160 if (MakeRegionExecutable(result)) { |
|
161 printf("ERROR | making negative control executable | %s\n", LastErrMsg()); |
|
162 return 0; |
|
163 } |
|
164 |
|
165 - printf("INFO | negative control allocated at 0x%.*"PRIxPTR"\n", |
|
166 + printf("INFO | negative control allocated at 0x%.*" PRIxPTR "\n", |
|
167 SIZxPTR, (uintptr_t)result); |
|
168 return (uintptr_t)result; |
|
169 } |
|
170 |
|
171 static void |
|
172 JumpTo(uintptr_t opaddr) |
|
173 { |
|
174 #ifdef __ia64 |