1
NOTE: this patch has already been applied, I'm just
2
keeping it here for future reference.
5
X-From-Line: debbugs@master.debian.org Mon Nov 12 15:11:01 2001
6
Return-Path: <debbugs@master.debian.org>
7
Delivered-To: david@someotherplace.org
8
Received: from master.debian.org (master.debian.org [216.234.231.5])
9
by zona.someotherplace.org (Postfix) with ESMTP id 74B7E7D006
10
for <david.coe@someotherplace.org>; Mon, 12 Nov 2001 15:11:00 -0500 (EST)
11
Received: from debbugs by master.debian.org with local (Exim 3.12 1 (Debian))
12
id 163NIO-0001Oj-00; Mon, 12 Nov 2001 14:03:04 -0600
13
Subject: Bug#119347: gpart: fix to build on ia64
14
Reply-To: Doug Porter <dsp@debian.org>, 119347@bugs.debian.org
15
Resent-From: Doug Porter <dsp@debian.org>
16
Original-Sender: dsp@waterspout.com
17
Resent-To: debian-bugs-dist@lists.debian.org
18
Resent-Cc: David Coe <davidc@debian.org>
19
Resent-Date: Mon, 12 Nov 2001 20:03:03 GMT
20
Resent-Message-ID: <handler.119347.B.10055952404995@bugs.debian.org>
21
X-Debian-PR-Message: report 119347
22
X-Debian-PR-Package: gpart
23
X-Debian-PR-Keywords: patch
24
X-Loop: owner@bugs.debian.org
25
Received: via spool by submit@bugs.debian.org id=B.10055952404995
26
(code B ref -1); Mon, 12 Nov 2001 20:03:03 GMT
27
From: Doug Porter <dsp@debian.org>
28
To: submit@bugs.debian.org
29
Date: Mon, 12 Nov 2001 15:00:23 -0500
30
Sender: dsp@waterspout.com
31
X-Gnus-Mail-Source: file:/var/mail/david
32
Message-Id: <20011112195918.2263D9B08@squall.waterspout.com>
33
Delivered-To: submit@bugs.debian.org
34
Resent-Sender: Debian BTS <debbugs@master.debian.org>
36
Xref: zona bugs.debian.org.owner:104
43
Currently the src/gm_ntfs.h that ships with gpart prevents gpart
44
from building on a number of Debian's supported architectures. I
45
have adapted some stuff that I pulled from recent 2.4 kernel
46
source that should allow gpart to build on most Debian platforms
50
diff -Naur gpart-0.1h.orig/src/gm_ntfs.h gpart-0.1h/src/gm_ntfs.h
51
--- gpart-0.1h.orig/src/gm_ntfs.h Mon Nov 12 19:56:57 2001
52
+++ gpart-0.1h/src/gm_ntfs.h Mon Nov 12 19:57:28 2001
58
+#include <asm/byteorder.h>
64
/* 'NTFS' in little endian */
65
#define NTFS_SUPER_MAGIC 0x5346544E
67
-#if defined(i386) || defined(__i386__) || defined(__alpha__) || defined(__arm__)
69
/* unsigned integral types */
70
#ifndef NTFS_INTEGRAL_TYPES
71
#define NTFS_INTEGRAL_TYPES
72
-typedef unsigned char ntfs_u8;
73
-typedef unsigned short ntfs_u16;
74
-typedef unsigned int ntfs_u32;
75
-typedef s64_t ntfs_u64;
76
+typedef uint8_t ntfs_u8;
77
+typedef uint16_t ntfs_u16;
78
+typedef uint32_t ntfs_u32;
79
+typedef uint64_t ntfs_u64;
80
+typedef int8_t ntfs_s8;
81
+typedef int16_t ntfs_s16;
82
#endif /* NTFS_INTEGRAL_TYPES */
83
-#endif /* defined(i386) || defined(__i386__) || defined(__alpha__) */
86
-/* Macros reading unsigned integers from a byte pointer */
87
-/* these should work for all little endian machines */
88
-#define NTFS_GETU8(p) (*(ntfs_u8*)(p))
89
-#define NTFS_GETU16(p) (*(ntfs_u16*)(p))
90
-#define NTFS_GETU24(p) (NTFS_GETU32(p) & 0xFFFFFF)
91
-#define NTFS_GETU32(p) (*(ntfs_u32*)(p))
92
-#define NTFS_GETU64(p) (*(ntfs_u64*)(p))
94
-/* Macros reading signed integers, returning int */
95
-#define NTFS_GETS8(p) ((int)(*(char*)(p)))
96
-#define NTFS_GETS16(p) ((int)(*(short*)(p)))
97
-#define NTFS_GETS24(p) (NTFS_GETU24(p) < 0x800000 ? (int)NTFS_GETU24(p) :
100
+#define CPU_TO_LE16(a) __cpu_to_le16(a)
101
+#define CPU_TO_LE32(a) __cpu_to_le32(a)
102
+#define CPU_TO_LE64(a) __cpu_to_le64(a)
104
+#define LE16_TO_CPU(a) __cpu_to_le16(a)
105
+#define LE32_TO_CPU(a) __cpu_to_le32(a)
106
+#define LE64_TO_CPU(a) __cpu_to_le64(a)
108
+/* Macros reading unsigned integers */
109
+#define NTFS_GETU8(p) (*(ntfs_u8*)(p))
110
+#define NTFS_GETU16(p) ((ntfs_u16)LE16_TO_CPU(*(ntfs_u16*)(p)))
111
+#define NTFS_GETU24(p) ((ntfs_u32)NTFS_GETU16(p) | \
112
+ ((ntfs_u32)NTFS_GETU8(((char*)(p)) + 2) << 16))
113
+#define NTFS_GETU32(p) ((ntfs_u32)LE32_TO_CPU(*(ntfs_u32*)(p)))
114
+#define NTFS_GETU64(p) ((ntfs_u64)LE64_TO_CPU(*(ntfs_u64*)(p)))
116
+/* Macros reading signed integers */
117
+#define NTFS_GETS8(p) ((*(ntfs_s8*)(p)))
118
+#define NTFS_GETS16(p) ((ntfs_s16)LE16_TO_CPU(*(short*)(p)))
119
+#define NTFS_GETS24(p) (NTFS_GETU24(p) < 0x800000 ? \
120
+ (int)NTFS_GETU24(p) : \
121
+ (int)(NTFS_GETU24(p) - 0x1000000))
123
#endif /* _GM_NTFS_H */
129
Doug Porter <dsp@waterspout.com>