PERFORCE change 29462 for review
Peter Wemm
peter at FreeBSD.org
Tue Apr 22 15:12:37 PDT 2003
http://perforce.freebsd.org/chv.cgi?CH=29462
Change 29462 by peter at peter_daintree on 2003/04/22 15:12:19
The bastards! My evil hack to offset the f*cked up internal
alignment of the tss struct (what the hell were they thinking??)
appears to be what was stopping me getting into user mode.
Oh well, CR4_AC (alignment checking) is off, so lets just give in
for now.
Affected files ...
.. //depot/projects/hammer/sys/x86_64/include/tss.h#8 edit
Differences ...
==== //depot/projects/hammer/sys/x86_64/include/tss.h#8 (text+ko) ====
@@ -47,39 +47,29 @@
* fields. It might be worth trying to set the tss on a +4 byte offset to
* make the 64 bit fields aligned in practice.
*/
-#pragma pack(1)
struct x86_64tss {
u_int32_t tss_rsvd0;
- u_int64_t tss_rsp0; /* kernel stack pointer ring 0 */
- u_int64_t tss_rsp1; /* kernel stack pointer ring 1 */
- u_int64_t tss_rsp2; /* kernel stack pointer ring 2 */
+ u_int64_t tss_rsp0 __packed; /* kernel stack pointer ring 0 */
+ u_int64_t tss_rsp1 __packed; /* kernel stack pointer ring 1 */
+ u_int64_t tss_rsp2 __packed; /* kernel stack pointer ring 2 */
u_int32_t tss_rsvd1;
u_int32_t tss_rsvd2;
u_int32_t tss_rsvd3;
- u_int64_t tss_ist1; /* Interrupt stack table 1 */
- u_int64_t tss_ist2; /* Interrupt stack table 2 */
- u_int64_t tss_ist3; /* Interrupt stack table 3 */
- u_int64_t tss_ist4; /* Interrupt stack table 4 */
- u_int64_t tss_ist5; /* Interrupt stack table 5 */
- u_int64_t tss_ist6; /* Interrupt stack table 6 */
- u_int64_t tss_ist7; /* Interrupt stack table 7 */
+ u_int64_t tss_ist1 __packed; /* Interrupt stack table 1 */
+ u_int64_t tss_ist2 __packed; /* Interrupt stack table 2 */
+ u_int64_t tss_ist3 __packed; /* Interrupt stack table 3 */
+ u_int64_t tss_ist4 __packed; /* Interrupt stack table 4 */
+ u_int64_t tss_ist5 __packed; /* Interrupt stack table 5 */
+ u_int64_t tss_ist6 __packed; /* Interrupt stack table 6 */
+ u_int64_t tss_ist7 __packed; /* Interrupt stack table 7 */
u_int32_t tss_rsvd4;
u_int32_t tss_rsvd5;
u_int16_t tss_rsvd6;
u_int16_t tss_iobase; /* io bitmap offset */
};
-#pragma pack()
#ifdef _KERNEL
-/*
- * Nasty hack to arrange internal alignment.
- * What were they thinking??
- */
-struct aligned_tss {
- u_int32_t pad;
- struct x86_64tss tss __packed;
-};
-extern struct aligned_tss common_tss;
+extern struct x86_64tss common_tss;
#endif
#endif /* _MACHINE_TSS_H_ */
More information about the p4-projects
mailing list