summaryrefslogtreecommitdiff
path: root/sys/arch/i386/include
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1995-12-21 15:04:16 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1995-12-21 15:04:16 +0000
commitff03969003f46d96286e6439be30b09abca28214 (patch)
treec698f239db28c0d66564a69c95bacc5bbdde24e9 /sys/arch/i386/include
parentbd645fc9a511af2139c0610e6ed02b92186eeb0d (diff)
from netbsd; use __attribute__((packed)) if it is available
Diffstat (limited to 'sys/arch/i386/include')
-rw-r--r--sys/arch/i386/include/segments.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/arch/i386/include/segments.h b/sys/arch/i386/include/segments.h
index a8fbb02c993..a33824797cd 100644
--- a/sys/arch/i386/include/segments.h
+++ b/sys/arch/i386/include/segments.h
@@ -1,4 +1,4 @@
-/* $NetBSD: segments.h,v 1.20 1995/10/12 17:57:01 mycroft Exp $ */
+/* $NetBSD: segments.h,v 1.22 1995/12/20 18:09:24 mycroft Exp $ */
/*-
* Copyright (c) 1995 Charles M. Hannum. All rights reserved.
@@ -72,7 +72,7 @@
#ifndef LOCORE
-#if __GNUC__ >= 2
+#if __GNUC__ == 2 && __GNUC_MINOR__ < 7
#pragma pack(1)
#endif
@@ -90,7 +90,7 @@ struct segment_descriptor {
unsigned sd_def32:1; /* default 32 vs 16 bit size */
unsigned sd_gran:1; /* limit granularity (byte/page) */
unsigned sd_hibase:8; /* segment base address (msb) */
-};
+} __attribute__((packed));
/*
* Gate descriptors (e.g. indirect descriptors)
@@ -104,7 +104,7 @@ struct gate_descriptor {
unsigned gd_dpl:2; /* segment descriptor priority level */
unsigned gd_p:1; /* segment descriptor present */
unsigned gd_hioffset:16; /* gate offset (msb) */
-};
+} __attribute__((packed));
/*
* Generic descriptor
@@ -112,7 +112,7 @@ struct gate_descriptor {
union descriptor {
struct segment_descriptor sd;
struct gate_descriptor gd;
-};
+} __attribute__((packed));
/*
* region descriptors, used to load gdt/idt tables before segments yet exist.
@@ -120,9 +120,9 @@ union descriptor {
struct region_descriptor {
unsigned rd_limit:16; /* segment extent */
unsigned rd_base:32; /* base address */
-};
+} __attribute__((packed));
-#if __GNUC__ >= 2
+#if __GNUC__ == 2 && __GNUC_MINOR__ < 7
#pragma pack(4)
#endif