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
390
391
392
393
394
395
396
397
398
399
400
401
402
403
|
2005-06-24 Neal H. Walfield <neal@gnu.org>
* physmem.c (main): Call frame_entry_init and frame_init before
calling create_bootstrap_caps.
Reported by Matthieu Lemerre <racin@free.fr>.
2005-06-22 Neal H. Walfield <neal@gnu.org>
* priv.h (frame_entry_init): Declare.
(frame_init): Declare.
* physmem.c (main): Call frame_entry_init and frame_init.
* frame-entry.c: Create a frame_entry slab class. Don't use
HURD_SLAB_SPACE_INITIALIZER to initialize frame_entry_space. Do
it ...
(frame_entry_init): ... here with hurd_frame_entry_slab_init.
(frame_entry_constructor): Update argument type given stronger
type checking.
(frame_entry_alloc): Call hurd_frame_entry_slab_alloc, not
hurd_slab_alloc.
(frame_entry_free): Call hurd_frame_entry_slab_dealloc, not
hurd_slab_dealloc.
* frame.c: Create a frame slab class. Don't use
HURD_SLAB_SPACE_INITIALIZER to initialize frame_space. Do it ...
(frame_init): ... here with hurd_frame_slab_init.
(frame_constructor): Update argument type given stronger type
checking.
(frame_alloc): Call hurd_frame_slab_alloc, not hurd_slab_alloc.
(frame_free): Call hurd_frame_slab_dealloc, not hurd_slab_dealloc.
2005-04-06 Neal H. Walfield <neal@gnu.org>
* physmem.h: Move from here...
* priv.h: ...to here. Improve
comments.
(extract_access): New function.
(struct frame): Add lock field. Change type of may_be_mapped
field from bool to l4_word_t.
(struct frame_entry): Add container, shared_next and shared_prevp
fields.
(frame_entry_free): Renamed from frame_entry_dealloc. Update
callers.
(frame_entry_create): Renamed from frame_entry_new. Update
callers.
(frame_entry_use): Renamed from frame_entry_use_frame. Update
callers.
(frame_entry_copy): New declaration.
(frame_entry_destroy): Renamed from frame_entry_drop. Update
callers.
(frame_entry_map): New declaration.
(frame_entry_deallocate): New declaration.
(frame_memory_bind): Assert that FRAME->LOCK is locked.
(frame_release): New definition.
(container_attach): Renamed from frame_entry_attach. Update
callers.
(frame_entry_detach): Renamed from frame_entry_detach. Update
callers.
* frame.c: Don't include "physmem.h". Include "priv.h" and
<pthread.h>.
(frame_dump): New function.
(frame_constructor): Initialize FRAME->LOCK and lock it.
(frame_space): It is a space of frame structures, no frame_entry
structures. Fix typo.
(frame_alloc): Initialize FRAME_MAY_BE_MAPPED. Assert FRAME->LOCK
is locked.
(frame_deref): When unmapping a frame, assert that FRAME->MEMORY
points to memory. Unlock FRAME->LOCK on return. Add sanity
checks.
(frame_add_user): Assert that FRAME->LOCK is locked.
(frame_drop_user): Assert that FRAME->LOCK is locked. Don't drop
a reference.
* frame-entry.c: Include <string.h> and "zalloc.h".
(frame_entry_constructor): New function.
(frame_entry_space): Use it.
(frame_entry_dump): Don't mark as static. Improve output. Add
some sanity checks.
(frame_entry_alloc): Assert that FRAME_ENTRY->SHARED_NEXT and
FRAME_ENTRY->SHARED_PREVP are correct.
(frame_entry_free): Add sanity checks.
[!NDEBUG]: Clear memory.
(frame_entry_share_with): New function.
(frame_entry_create): Assert CONT->LOCK is held. Initialize
FRAME_ENTRY->CONTAINER. Initialize share list.
(frame_entry_copy): New function.
(frame_entry_use): Assert CONT->LOCK and SOURCE->LOCK are held.
Set FRAME_ENTRY->CONTAINER. Initialize share list.
(frame_entry_destroy): If CONT is NULL, don't try to detach
FRAME_ENTRY from a container. Assert CONT->LOCK in CONT is
non-NULL and SOURCE->LOCK are held. Correctly update COW count.
Only unlock FRAME_ENTRY->LOCK if DO_UNLOCK is true.
(frame_entry_attach): Moved to container.c and renamed to
container_attach.
(frame_entry_detach): Moved to container.c and renamed to
container_detach.
(frame_entry_map): New function.
(frame_entry_deallocate): New function.
* container.c: Include <string.h> and "priv.h".
(container_dump): New function.
(container_attach): Moved from frame-entry.c and renamed from
frame_entry_attach.
(container_detach): Moved from frame-entry.c and renamed from
frame_entry_detach.
(container_allocate): Lock CONT->LOCK. Don't check the return
value of FRAME_ENTRY_ALLOC for errors: it is guaranteed to
succeed. Unlock FE->FRAME->LOCK and CONT->LOCK.
(container_deallocate): Lock CONT->LOCK. Refactor iteration.
Rewrite body to use frame_entry_deallocate. Return the number of
bytes allocated.
(container_map): Refactor iteration. Rewrite body to use
frame_entry_map.
(container_copy): If HURD_PM_CONT_ALL_OR_NONE is set try better to
make sure the operation won't fail mid-flight. Lock
SFE->FRAME->LOCK. If the copy is a copy on write and the frame
has extant write mappings, remove them.
(container_ops): Moved to physmem.h. Preface names with hurd_pm_
to reflect presence in the global name space.
(container_demuxer): If the invoke method produces returns an
error code, emit a debugging message.
(container_alloc) [!NDEBUG]: Lock CONT->LOCK.
Unlock FE->FRAME->LOCK.
(container_init): New function.
(container_reinit): Assert CONT->LOCK is held.
(container_class_init): Use CONTAINER_INIT.
* physmem.h: New file.
* headers.m4: New file.
* physmem.c: Don't include "physmem.h". Include "priv.h".
* ia32-cmain.c: Likewise.
2005-03-09 Neal H. Walfield <neal@gnu.org>
* container.c (container_allocate): Set err to ENOMEM when
frame_entry_alloc fails.
2005-03-09 Neal H. Walfield <neal@gnu.org>
* container.c (container_map): Update argument marshalling.
Sanity check SIZE and VADDR.
(container_copy): Strengthen the argument checking.
2005-03-08 Neal H. Walfield <neal@gnu.org>
* container.c (container_create): Lock OBJ before calling
hurd_cap_obj_drop.
Reported by Matthieu Lemerre <racin@free.fr>.
2005-03-08 Neal H. Walfield <neal@gnu.org>
* physmem.h (struct frame): Add field cow.
(frame_entry_use_frame): Rename from frame_entry_use. Change
interface such that FRAME must refer to a valid frame. Update
users.
(frame_add_user): Rename from frame_add. Update users.
(frame_drop_user): Rename from frame_drop. Update users.
* container.c (container_map): Take FRAME_ENTRY->FRAME_OFFSET
into account when determining the physical memory.
(container_copy): New function.
(enum container_ops): Add container_copy_id.
(container_demuxer): Recognize container_copy_id.
* frame-entry.c (frame_entry_new): Allocate FRAME_ENTRY->frame.
Add FRAME_ENTRY as a user of the allocated frame. Update callers.
(frame_entry_use_frame): Add FRAME_ENTRY as a user of FRAME.
(frame_entry_drop): Drop FRAME_ENTRY as a user of the underlying
frame.
* frame.c (frame_constructor): Initialize FRAME->cow.
(frame_alloc): Add an assert.
2005-01-11 Neal H. Walfield <neal@gnu.org>
* Makefile.am (physmem_SOURCES): Add frame-entry.c and frame.c
(physmem_LDADD): Add ../libhurd-btree/libhurd-btree.a.
* frame-entry.c: New file.
* frame.c: New file.
* README: Rewrite.
* container.c: Likewise.
* physmem.h: Likewise.
* physmem.c (create_bootstrap_caps): Change container_t to struct
container *.
2005-01-07 Neal H. Walfield <neal@gnu.org>
* output.h (debug): Preface __VA_ARGS__ with ## thereby making it
optional.
2004-11-17 Neal H. Walfield <neal@gnu.org>
* Makefile.am (bootdir): New variable.
(boot_PROGRAMS): Use this instead of noinst_PROGRAMS.
2004-11-17 Neal H. Walfield <neal@gnu.org>
* output.h (debug): Include program_name and __FUNCTION__ in
output.
* physmem.c (create_bootstrap_caps): First argument to
debug must be a constant format string.
2004-11-01 Marcus Brinkmann <marcus@gnu.org>
* container.c (struct container, container_t): Remove member OBJ.
Move struct and typedef to ...
* physmem.h (struct container, container_t): ... here.
(container_alloc): Change type of last argument in prototype to a
pointer to a container_t.
* container.c (container_reinit, container_map): Use
hurd_cap_obj_to_user instead cast.
(container_class_init): Provide type instead size and alignment.
(container_alloc): Add new variable OBJ and use hurd_cap_obj_to_user.
Change type of last argument to a pointer to container_t.
* physmem.c (create_bootstrap_caps): New variable CONTAINER.
Use hurd_cap_obj_from_user to get at the object.
* container.c: Include "zalloc.h".
* physmem.c (create_bootstrap_caps): Remove unused variables
STARTUP_CAP, NR_FPAGES, FPAGES.
2004-10-29 Marcus Brinkmann <marcus@gnu.org>
* ia32-cmain.c (switch_thread): Correct start of small sub stack
address. Reported by Rian Hunter <hurd@thelaststop.net>.
2004-10-28 Marcus Brinkmann <marcus@gnu.org>
* physmem.c (get_task_cap): Removed.
(bootstrap_final): New function.
(main): Call bootstrap_final, not get_task_cap.
2004-10-27 Marcus Brinkmann <marcus@gnu.org>
* container.c (container_map): Call l4_fpage_xspan instead of
l4_fpage_span.
2004-10-25 Marcus Brinkmann <marcus@gnu.org>
* physmem.c (physmem_server): Call hurd_cap_bucket_worker_alloc.
2004-10-20 Marcus Brinkmann <marcus@gnu.org>
* malloc-wrap.c: Do not include zalloc.h here.
(USE_MALLOC_LOCK): Define.
2004-07-16 Bas Wijnen <b.wijnen@phys.rug.nl>
* physmem.c (physmem_server): Added missing parameter.
2004-04-26 Marcus Brinkmann <marcus@gnu.org>
* physmem.c: Include <hurd/wortel.h>.
(wortel_thread_id, wortel_cap_id): New variables.
(get_all_memory): Rewritten using wortel interface.
(create_bootstrap_caps): Likewise.
(get_threads): Likewise.
(get_task_cap): Likewise.
(main): Initialize wortel_thread_id.
* output.c (shutdown): Include <hurd/wortel.h>.
(shutdown): Rewritten using wortel interface.
(putchar): Rewritten using wortel interface.
2004-04-15 Marcus Brinkmann <marcus@gnu.org>
* container.c (container_map): New function.
(container_demux): Call container_map.
2004-04-11 Marcus Brinkmann <marcus@gnu.org>
* physmem.c (get_task_cap): New function.
(main): Call get_task_cap.
* container.c (container_reinit): Unmap the fpages before
returning them to the pool.
2004-04-10 Marcus Brinkmann <marcus@gnu.org>
* container.c: Include <l4/space.h>. Use L4_FPAGE_SPAN_MAX
instead MAX_FPAGES everywhere.
(container_reinit): New function.
(container_class_init): Pass container_reinit as reinit function.
(MAX_FPAGES): Removed.
2004-04-09 Marcus Brinkmann <marcus@gnu.org>
* container.c: Revert last change.
* physmem.h: Revert last change.
* physmem.c (MAX_FPAGES): Removed macro.
(create_bootstrap_caps): Use L4_FPAGE_SPAN_MAX, not MAX_FPAGES.
Update bootstrap cap code to new wortel interface (essentially
reverting the last change).
* physmem.h: Include <stdbool.h>.
* container.c (struct container): Add member mapped.
(container_alloc): Add new argument mapped. Initialize
CONTAINER->mapped.
* Makefile.am (physmem_LDADD): Add
../libhurd-cap-server/libhurd-cap-server.a and
../libhurd-slab/libhurd-slab.a.
(physmem_SOURCES): Add container.c.
* container.c: New file.
* physmem.h: Include <hurd/cap-server.h> and <errno.h>.
(container_class_init, container_alloc): New prototypes.
* physmem.c (create_bootstrap_caps): Take new argument bucket.
Create container capabilities and inject them into the bucket.
(getpagesize): New temporary helper function.
(physmem_server): New function.
(main): New variable BUCKET. Create capability bucket. Pass
BUCKET to create_bootstrap_caps. New variable MANAGER. Create
manager thread.
2004-04-06 Marcus Brinkmann <marcus@gnu.org>
* physmem.c (setup_threads): Add threads to pool after creating
main thread. Don't overwrite server_thread with an incorrect
value at the end.
2004-03-19 Marcus Brinkmann <marcus@gnu.org>
* physmem.c (WORTEL_MSG_GET_THREADS): New macro.
(setup_threads): Request number of extra threads from wortel. Add
them to the pool.
* output.h (shutdown): Add noreturn attribute to prototype.
* output.c (shutdown): Add noreturn attribute. Sleep forever.
* config.m4 (HURD_LOAD_ADDRESS): Change load address to 0x400000.
* physmem.c: Include pthread.h.
(setup_threads): New function.
(main): New variable SERVER_THREAD. Call setup_threads.
(exit, abort): New functions.
* physmem.h (switch_thread): Add prototype.
* ia32-cmain.c (switch_thread): New function.
(__thread_stack_pointer): New macro.
(__thread_set_stack_pointer): New macro.
* Makefile.am (physmem_LDADD): Add ../libpthread/libpthread.a and
../libhurd-ihash/libhurd-ihash.a.
2004-03-16 Marcus Brinkmann <marcus@gnu.org>
* output.c (putchar): Replace all &msg with msg. Update
everything to new API.
* physmem.c: Likewise.
2003-10-26 Marcus Brinkmann <marcus@gnu.org>
* Makefile.am (physmem_CPPFLAGS): Use top_builddir for include
directory.
2003-10-24 Daniel Wagner <wagi@gmx.ch>
* Makefile.am (physmem_CPPFLAGS): Use top_scrdir instead of
top_builddir.
2003-10-16 Marcus Brinkmann <marcus@gnu.org>
* output.c (shutdown): New function.
* physmem.c: Include <stdlib.h>.
(get_all_memory): Update to match new wortel interface.
(create_bootstrap_caps): New function.
(main): Call create_bootstrap_caps.
2003-10-12 Marcus Brinkmann <marcus@gnu.org>
* config.m4: New file.
* Makefile.am (physmem_LDFLAGS): Replace load address with
@HURD_PHYSMEM_LOAD_ADDRESS@.
2003-09-24 Marcus Brinkmann <marcus@gnu.org>
* mmap.c: New file.
* Makefile.am (physmem_SOURCES): Add mmap.c.
* malloc-wrap.c (LACKS_SYS_MMAN_H, mmap, munmap, PROT_READ,
PROT_WRITE, MAP_PRIVATE, MAP_ANONYMOUS, MUNMAP_FAILURE): Remove
macros.
2003-09-22 Marcus Brinkmann <marcus@gnu.org>
* Makefile.am (AM_CPPFLAGS, physmem_CFLAGS): Removed.
(physmem_CPPFLAGS): New variable.
(physmem_SOURCES): Add malloc-wrap.c.
(EXTRA_physmem_SOURCES): New variable.
* malloc.c, malloc-wrap.c: New files.
2003-09-21 Marco Gerards <metgerards@student.han.nl>
* Makefile.am (AM_CPPFLAGS): New variable.
2003-09-19 Marcus Brinkmann <marcus@gnu.org>
* physmem.c: Include "zalloc.h".
* zalloc.c: Include <string.h>, not <strings.h>.
(add_block): Add missing return type.
(zalloc_dump_zones): Use %p for pointer.
* zalloc.c (L4_MIN_PAGE_SHIFT): Remove macro.
(ZONE_SIZE): Use L4_MIN_PAGE_SIZE_LOG2 instead of L4_MIN_PAGE_SHIFT.
(ZONES): Likewise.
(zfree): Likewise.
(zalloc): Likewise.
* physmem/Makefile.am (physmem_SOURCES): Remove getpagesize.c.
* getpagesize.c: File removed.
* physmem/zalloc.c (zfree): Use l4_min_page_size() instead
getpagesize().
(zalloc): Likewise.
(zalloc_dump_zones): Likewise.
|