diff options
author | Thomas Schwinge <tschwinge@gnu.org> | 2007-05-07 22:04:54 +0000 |
---|---|---|
committer | Thomas Schwinge <tschwinge@gnu.org> | 2009-06-18 00:27:10 +0200 |
commit | 2c1f7f5ef7e2252312ecfa77b2352e89669006bf (patch) | |
tree | 503d5b28de51384b4789b75a8ec506132c795349 /kern | |
parent | 029ea3ffa9e56d33eef2e859c98848f722f63b1c (diff) |
2007-05-07 Thomas Schwinge <tschwinge@gnu.org>
[bug #15295 --- ``Mach lets processes write to I/O ports'']
* i386/Makefrag.am (libkernel_a_SOURCES): Add `i386/i386/io_perm.c',
`i386/i386/io_perm.h', `i386/i386/machine_task.c', `i386/i386/task.h'
and remove `i386/i386/io_port.h', `i386/i386/iopb.c',
`i386/i386/iopb.h'.
* i386/i386/io_port.h: Remove file.
* i386/i386at/kd.c: Don't include <i386/io_port.h>.
(vga_port_list, kd_io_device, kd_io_map_open, kd_io_map_close): Don't
define and don't use anymore.
* include/stddef.h: New file.
* i386/i386/io_perm.c: Include <string.h>, <device/device_emul.h>,
<ipc/ipc_space.h> and don't include <oskit/ds_oskit.h>.
(io_perm_device_emulation_ops): New variable.
(dev_open_alloc, setup_no_senders): Remove declarations.
(convert_io_perm_to_port, convert_port_to_io_perm, io_perm_deallocate):
Rewrite.
(no_senders): New function.
(i386_io_perm_create, i386_io_perm_modify): Rewrite partially, to adapt
to the GNU Mach environment.
* i386/i386/io_perm.h: Include <device/dev_hdr.h> and
<ipc/ipc_types.h>.
(io_perm, io_perm_t): New structure and accompanying type definition.
(IO_PERM_NULL): Define.
* i386/i386/locore.S (ktss): Move variable to...
* i386/i386/ktss.c: ... here, make it a ``struct task_tss''.
(ktss_init): Initialize the `task_tss' structure and the i/o permission
bit map.
* i386/i386/ktss.h: Adapt to that.
* i386/i386/machine_task.c (machine_task_module_init): Adapt the `zinit'
call to the GNU Mach environment.
* i386/i386/mp_desc.c: Include <machine/ktss.h>.
* i386/i386/tss.h: Include <machine/io_perm.h>.
(task_tss): New structure, equivalent to the OSKit-Mach one.
* i386/include/mach/i386/mach_i386.defs: Don't include
<device/device_types.defs>.
(device_list_t): Remove type.
* i386/include/mach/i386/mach_i386_types.h (device_list_t): Remove type
definition.
2007-05-07 Marcus Brinkmann <marcus@gnu.org>
[bug #15295 --- ``Mach lets processes write to I/O ports'']
* i386/i386/iopb.h, i386/i386/iopb.c: Obsolete files removed.
* i386/i386/pcb.c (switch_context): Update the I/O permission
bitmap from stack_handoff() here (not only in stack_handoff()).
* i386/i386/machine_task.c (machine_task_module_init): Set
ZONE_COLLECTABLE and ZONE_EXHAUSTIBLE flags for the iopb zone.
Requested by Roland McGrath <roland@frob.com>.
* i386/i386/io_perm.h: New file.
* i386/i386/io_perm.c: New file.
* i386/i386/machine_task.c: New file.
* i386/i386/mp_desc.h: (struct mp_desc_table): Change type of ktss to
struct task_tss.
(mp_ktss): Likewise for array of pointers to the struct.
* i386/i386/mp_desc.c: Include `machine/tss.h' and `machine/io_perm.h'.
(mp_ktss): Change type to array of struct task_tss.
(mp_desc_init): Cast pointer to x86_tss into pointer to task_tss,
and use size of struct task_tss instead size of struct x86_tss.
Initialize the task_tss structure.
* i386/i386/pcb.c: Include `stddef.h' and `machine/tss.h'.
(iopb_create, iopb_destroy): Prototypes removed.
(curr_ktss): Cast pointer to base_tss to pointer to struct
task_tss.
(switch_ktss): Always use kernel TSS.
(update_ktss_iopb): New function.
(stack_handoff): Call update_ktss_iopb.
(pcb_module_init): Do not call iopb_init.
(pcb_terminate): Do not call iopb_destroy.
(thread_setstatus): Remove local variable tss.
(thread_getstatus): Rewrite i386_ISA_PORT_MAP_STATE case handler.
* i386/i386/task.h: New file.
* i386/i386/thread.h: Do not include `i386/iopb.h'.
(struct i386_machine_state): Remove member io_tss.
* i386/include/mach/i386/mach_i386.defs [KERNEL_SERVER]: Include
`machine/io_perm.h'. Define intran, outtran and destructor.
(io_port_t): New type.
(io_perm_t): Likewise.
(i386_io_port_add): Interface removed.
(i386_io_port_remove): Likewise.
(i386_io_port_list): Likewise.
(i386_io_perm_create): New interface.
(i386_io_perm_modify): Likewise.
* i386/include/mach/i386/mach_i386_types.h [MACH_KERNEL]: Include
`i386/io_perm.h'.
[!MACH_KERNEL]: Define types io_port_t and io_perm_t.
* kern/task.c (task_init): Call machine_task_module_init.
(task_create): Call machine_task_init.
(task_deallocate): Call machine_task_terminate.
(task_collect_scan): Call machine_task_collect.
* task.h: Include `machine/task.h'.
(struct task): Add member machine.
Diffstat (limited to 'kern')
-rw-r--r-- | kern/task.c | 5 | ||||
-rw-r--r-- | kern/task.h | 4 |
2 files changed, 9 insertions, 0 deletions
diff --git a/kern/task.c b/kern/task.c index 1c4c673..45c59c5 100644 --- a/kern/task.c +++ b/kern/task.c @@ -67,6 +67,7 @@ void task_init(void) 0, "tasks"); eml_init(); + machine_task_module_init (); /* * Create the kernel task as the first task. @@ -145,6 +146,7 @@ kern_return_t task_create( eml_task_reference(new_task, parent_task); ipc_task_init(new_task, parent_task); + machine_task_init (new_task); new_task->total_user_time.seconds = 0; new_task->total_user_time.microseconds = 0; @@ -220,6 +222,8 @@ void task_deallocate( if (c != 0) return; + machine_task_terminate (task); + eml_task_deallocate(task); pset = task->processor_set; @@ -1092,6 +1096,7 @@ void task_collect_scan(void) pset_unlock(pset); simple_unlock(&all_psets_lock); + machine_task_collect (task); pmap_collect(task->map->pmap); if (prev_task != TASK_NULL) diff --git a/kern/task.h b/kern/task.h index dce3a76..1337a98 100644 --- a/kern/task.h +++ b/kern/task.h @@ -46,6 +46,7 @@ #include <kern/processor.h> #include <kern/syscall_emulation.h> #include <vm/vm_types.h> +#include <machine/task.h> struct task { /* Synchronization/destruction information */ @@ -98,6 +99,9 @@ struct task { vm_offset_t fast_tas_base[TASK_FAST_TAS_NRAS]; vm_offset_t fast_tas_end[TASK_FAST_TAS_NRAS]; #endif /* FAST_TAS */ + + /* Hardware specific data. */ + machine_task_t machine; }; #define task_lock(task) simple_lock(&(task)->lock) |