summaryrefslogtreecommitdiff
path: root/debian/patches/0010-fu-macros.patch
blob: 9c63e62811f4dd66f6979ae7cc72580986c2c2f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
From 0d54d70650a73dabe12660e90cf704e85e9ce59f Mon Sep 17 00:00:00 2001
From: Justus Winter <4winter@informatik.uni-hamburg.de>
Date: Sat, 16 May 2015 14:55:14 +0200
Subject: [PATCH gnumach 10/10] fu macros

---
 Makefrag.am             |  1 -
 device/dev_master.h     |  2 +-
 device/io_req.h         |  2 +-
 device/net_io.h         |  2 +-
 i386/intel/read_fault.c |  2 +-
 ipc/ipc_kmsg.h          |  2 +-
 ipc/ipc_mqueue.h        |  2 +-
 ipc/ipc_object.h        |  2 +-
 ipc/ipc_port.h          |  2 +-
 ipc/ipc_space.h         |  2 +-
 kern/assert.h           |  2 +-
 kern/ast.h              |  2 +-
 kern/macro_help.h       | 50 -------------------------------------------------
 kern/macros.h           |  1 +
 kern/pc_sample.h        |  2 +-
 kern/refcount.h         |  2 +-
 kern/sched.h            |  2 +-
 kern/sched_prim.c       |  2 +-
 kern/timer.c            |  2 +-
 kern/timer.h            |  2 +-
 vm/vm_fault.c           |  2 +-
 vm/vm_map.h             |  2 +-
 vm/vm_object.h          |  2 +-
 vm/vm_page.h            |  2 +-
 24 files changed, 22 insertions(+), 72 deletions(-)
 delete mode 100644 kern/macro_help.h

diff --git a/Makefrag.am b/Makefrag.am
index 1b09fc3..023a4d1 100644
--- a/Makefrag.am
+++ b/Makefrag.am
@@ -167,7 +167,6 @@ libkernel_a_SOURCES += \
 	kern/mach_factor.h \
 	kern/machine.c \
 	kern/machine.h \
-	kern/macro_help.h \
 	kern/macros.h \
 	kern/pc_sample.c \
 	kern/pc_sample.h \
diff --git a/device/dev_master.h b/device/dev_master.h
index 6ad1152..70d4c63 100644
--- a/device/dev_master.h
+++ b/device/dev_master.h
@@ -37,7 +37,7 @@
 
 #if	NCPUS > 1
 
-#include <kern/macro_help.h>
+#include <kern/macros.h>
 #include <kern/cpu_number.h>
 #include <kern/sched_prim.h>
 #include <kern/thread.h>
diff --git a/device/io_req.h b/device/io_req.h
index 65e23e6..1ad4680 100644
--- a/device/io_req.h
+++ b/device/io_req.h
@@ -42,7 +42,7 @@
 #include <device/device_types.h>
 #include <device/dev_hdr.h>
 
-#include <kern/macro_help.h>
+#include <kern/macros.h>
 
 /*
  * IO request element, queued on device for delayed replies.
diff --git a/device/net_io.h b/device/net_io.h
index f6de854..d4e24d4 100644
--- a/device/net_io.h
+++ b/device/net_io.h
@@ -38,7 +38,7 @@
 #include <mach/machine/vm_types.h>
 #include <ipc/ipc_kmsg.h>
 
-#include <kern/macro_help.h>
+#include <kern/macros.h>
 #include <kern/lock.h>
 #include <kern/kalloc.h>
 
diff --git a/i386/intel/read_fault.c b/i386/intel/read_fault.c
index 29f4439..4b1edce 100644
--- a/i386/intel/read_fault.c
+++ b/i386/intel/read_fault.c
@@ -31,7 +31,7 @@
 #include <vm/vm_page.h>
 #include <vm/pmap.h>
 
-#include <kern/macro_help.h>
+#include <kern/macros.h>
 
 /*
  *	Expansion of vm_fault for read fault in kernel mode.
diff --git a/ipc/ipc_kmsg.h b/ipc/ipc_kmsg.h
index 620785b..393c039 100644
--- a/ipc/ipc_kmsg.h
+++ b/ipc/ipc_kmsg.h
@@ -38,7 +38,7 @@
 #include <mach/message.h>
 #include <kern/assert.h>
 #include <kern/cpu_number.h>
-#include <kern/macro_help.h>
+#include <kern/macros.h>
 #include <kern/kalloc.h>
 #include <ipc/ipc_marequest.h>
 #include <ipc/ipc_object.h>
diff --git a/ipc/ipc_mqueue.h b/ipc/ipc_mqueue.h
index f8a2f1e..2af5e02 100644
--- a/ipc/ipc_mqueue.h
+++ b/ipc/ipc_mqueue.h
@@ -37,7 +37,7 @@
 #include <mach/message.h>
 #include <kern/assert.h>
 #include <kern/lock.h>
-#include <kern/macro_help.h>
+#include <kern/macros.h>
 #include <ipc/ipc_kmsg_queue.h>
 #include <ipc/ipc_kmsg.h>
 #include <ipc/ipc_thread.h>
diff --git a/ipc/ipc_object.h b/ipc/ipc_object.h
index b83bb5a..be5bea7 100644
--- a/ipc/ipc_object.h
+++ b/ipc/ipc_object.h
@@ -38,7 +38,7 @@
 #include <mach/message.h>
 #include <ipc/ipc_types.h>
 #include <kern/lock.h>
-#include <kern/macro_help.h>
+#include <kern/macros.h>
 #include <kern/slab.h>
 
 typedef unsigned int ipc_object_refs_t;
diff --git a/ipc/ipc_port.h b/ipc/ipc_port.h
index 6914c71..ade6967 100644
--- a/ipc/ipc_port.h
+++ b/ipc/ipc_port.h
@@ -43,7 +43,7 @@
 #include <mach/kern_return.h>
 #include <mach/port.h>
 #include <kern/lock.h>
-#include <kern/macro_help.h>
+#include <kern/macros.h>
 #include <kern/ipc_kobject.h>
 #include <ipc/ipc_mqueue.h>
 #include <ipc/ipc_table.h>
diff --git a/ipc/ipc_space.h b/ipc/ipc_space.h
index 404f708..58fe47c 100644
--- a/ipc/ipc_space.h
+++ b/ipc/ipc_space.h
@@ -43,7 +43,7 @@
 #include <mach/kern_return.h>
 #include <mach/mach_types.h>
 #include <machine/vm_param.h>
-#include <kern/macro_help.h>
+#include <kern/macros.h>
 #include <kern/lock.h>
 #include <kern/rdxtree.h>
 #include <kern/slab.h>
diff --git a/kern/assert.h b/kern/assert.h
index bd2a8be..7b66d1b 100644
--- a/kern/assert.h
+++ b/kern/assert.h
@@ -29,7 +29,7 @@
 
 /*	assert.h	4.2	85/01/21	*/
 
-#include <kern/macro_help.h>
+#include <kern/macros.h>
 
 #ifndef NDEBUG
 #define MACH_ASSERT 1
diff --git a/kern/ast.h b/kern/ast.h
index 4c28b1e..7d472be 100644
--- a/kern/ast.h
+++ b/kern/ast.h
@@ -41,7 +41,7 @@
  */
 
 #include "cpu_number.h"
-#include <kern/macro_help.h>
+#include <kern/macros.h>
 #include <machine/ast.h>
 
 /*
diff --git a/kern/macro_help.h b/kern/macro_help.h
deleted file mode 100644
index 7ce171f..0000000
--- a/kern/macro_help.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* 
- * Mach Operating System
- * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
- * All Rights Reserved.
- * 
- * Permission to use, copy, modify and distribute this software and its
- * documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- * 
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
- * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- * 
- * Carnegie Mellon requests users of this software to return to
- * 
- *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
- *  School of Computer Science
- *  Carnegie Mellon University
- *  Pittsburgh PA 15213-3890
- * 
- * any improvements or extensions that they make and grant Carnegie Mellon
- * the rights to redistribute these changes.
- */
-/*
- *	File:	kern/macro_help.h
- *
- *	Provide help in making lint-free macro routines
- *
- */  
-
-#ifndef	_KERN_MACRO_HELP_H_
-#define	_KERN_MACRO_HELP_H_
-
-#if	!defined(MACRO_BEGIN)
-
-#include <mach/boolean.h>
-
-#define		NEVER		FALSE
-#define		ALWAYS		TRUE
-
-#define		MACRO_BEGIN	({
-#define		MACRO_END	})
-
-#define		MACRO_RETURN	if (ALWAYS) return
-
-#endif	/* !MACRO_BEGIN */
-
-#endif	/* _KERN_MACRO_HELP_H_ */
diff --git a/kern/macros.h b/kern/macros.h
index db38842..fb8dc5e 100644
--- a/kern/macros.h
+++ b/kern/macros.h
@@ -23,6 +23,7 @@
 
 #define MACRO_BEGIN         ({
 #define MACRO_END           })
+#define	MACRO_RETURN	if (1) return
 
 #define __QUOTE(x)          #x
 #define QUOTE(x)            __QUOTE(x)
diff --git a/kern/pc_sample.h b/kern/pc_sample.h
index 3c64068..4832cb9 100644
--- a/kern/pc_sample.h
+++ b/kern/pc_sample.h
@@ -49,7 +49,7 @@
 #include <mach/pc_sample.h>
 #include <mach/machine/vm_types.h>
 #include <kern/kern_types.h>
-#include <kern/macro_help.h>
+#include <kern/macros.h>
 
 /*
  *	Control structure for sampling, included in
diff --git a/kern/refcount.h b/kern/refcount.h
index 74204d6..f32feb8 100644
--- a/kern/refcount.h
+++ b/kern/refcount.h
@@ -27,7 +27,7 @@
 #ifndef	_KERN_REFCOUNT_H_
 #define _KERN_REFCOUNT_H_
 
-#include <kern/macro_help.h>
+#include <kern/macros.h>
 
 /* Unless the above include file specified otherwise,
    use the system-independent (unoptimized) atomic reference counter.  */
diff --git a/kern/sched.h b/kern/sched.h
index ea601c5..f82f9f5 100644
--- a/kern/sched.h
+++ b/kern/sched.h
@@ -38,7 +38,7 @@
 #include <kern/queue.h>
 #include <kern/lock.h>
 #include <kern/kern_types.h>
-#include <kern/macro_help.h>
+#include <kern/macros.h>
 
 #if	MACH_FIXPRI
 #include <mach/policy.h>
diff --git a/kern/sched_prim.c b/kern/sched_prim.c
index d7792ae..e8f260e 100644
--- a/kern/sched_prim.c
+++ b/kern/sched_prim.c
@@ -44,7 +44,7 @@
 #include <kern/lock.h>
 #include <kern/mach_clock.h>
 #include <kern/mach_factor.h>
-#include <kern/macro_help.h>
+#include <kern/macros.h>
 #include <kern/processor.h>
 #include <kern/queue.h>
 #include <kern/sched.h>
diff --git a/kern/timer.c b/kern/timer.c
index 6d6517e..79ada27 100644
--- a/kern/timer.c
+++ b/kern/timer.c
@@ -33,7 +33,7 @@
 #include <kern/cpu_number.h>
 
 #include <kern/assert.h>
-#include <kern/macro_help.h>
+#include <kern/macros.h>
 
 
 
diff --git a/kern/timer.h b/kern/timer.h
index 57f017a..2f473cf 100644
--- a/kern/timer.h
+++ b/kern/timer.h
@@ -27,7 +27,7 @@
 #ifndef	_KERN_TIMER_H_
 #define _KERN_TIMER_H_
 
-#include <kern/macro_help.h>
+#include <kern/macros.h>
 
 #if	STAT_TIME
 /*
diff --git a/vm/vm_fault.c b/vm/vm_fault.c
index 686156c..0fa4d6a 100644
--- a/vm/vm_fault.c
+++ b/vm/vm_fault.c
@@ -51,7 +51,7 @@
 #include <mach/memory_object.h>
 #include <vm/memory_object_user.user.h>
 				/* For memory_object_data_{request,unlock} */
-#include <kern/macro_help.h>
+#include <kern/macros.h>
 #include <kern/slab.h>
 
 #if	MACH_PCSAMPLE
diff --git a/vm/vm_map.h b/vm/vm_map.h
index b8103eb..fc7730a 100644
--- a/vm/vm_map.h
+++ b/vm/vm_map.h
@@ -52,7 +52,7 @@
 #include <vm/vm_types.h>
 #include <kern/lock.h>
 #include <kern/rbtree.h>
-#include <kern/macro_help.h>
+#include <kern/macros.h>
 
 /* TODO: make it dynamic */
 #define KENTRY_DATA_SIZE (256*PAGE_SIZE)
diff --git a/vm/vm_object.h b/vm/vm_object.h
index 5c42f56..3bfc67a 100644
--- a/vm/vm_object.h
+++ b/vm/vm_object.h
@@ -45,7 +45,7 @@
 #include <kern/lock.h>
 #include <kern/assert.h>
 #include <kern/debug.h>
-#include <kern/macro_help.h>
+#include <kern/macros.h>
 #include <vm/pmap.h>
 #include <ipc/ipc_types.h>
 
diff --git a/vm/vm_page.h b/vm/vm_page.h
index 4fe1b41..e6a8c49 100644
--- a/vm/vm_page.h
+++ b/vm/vm_page.h
@@ -42,7 +42,7 @@
 #include <kern/queue.h>
 #include <kern/lock.h>
 
-#include <kern/macro_help.h>
+#include <kern/macros.h>
 #include <kern/sched_prim.h>	/* definitions of wait/wakeup */
 
 #if	MACH_VM_DEBUG
-- 
2.1.4