Updates caused by renaming vm_translation_map_get_pgdir() to
i386_translation_map_get_pgdir(). Fixed some warnings. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5067 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
fb7bec78e3
commit
14d9cc14d9
@ -3,6 +3,7 @@
|
|||||||
** Distributed under the terms of the NewOS License.
|
** Distributed under the terms of the NewOS License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <kernel.h>
|
#include <kernel.h>
|
||||||
#include <boot/stage2.h>
|
#include <boot/stage2.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
@ -152,7 +153,7 @@ arch_thread_switch_kstack_and_call(struct thread *t, addr new_kstack, void (*fun
|
|||||||
void
|
void
|
||||||
arch_thread_context_switch(struct thread *t_from, struct thread *t_to)
|
arch_thread_context_switch(struct thread *t_from, struct thread *t_to)
|
||||||
{
|
{
|
||||||
addr new_pgdir;
|
void *new_pgdir;
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
int i;
|
int i;
|
||||||
@ -181,23 +182,23 @@ arch_thread_context_switch(struct thread *t_from, struct thread *t_to)
|
|||||||
new_pgdir = NULL;
|
new_pgdir = NULL;
|
||||||
} else {
|
} else {
|
||||||
// switching to a new address space
|
// switching to a new address space
|
||||||
new_pgdir = vm_translation_map_get_pgdir(&t_to->team->aspace->translation_map);
|
new_pgdir = i386_translation_map_get_pgdir(&t_to->team->aspace->translation_map);
|
||||||
}
|
}
|
||||||
} else if (t_from->team->_aspace_id < 0 && t_to->team->_aspace_id < 0) {
|
} else if (t_from->team->_aspace_id < 0 && t_to->team->_aspace_id < 0) {
|
||||||
// they must both be kspace threads
|
// they must both be kspace threads
|
||||||
new_pgdir = NULL;
|
new_pgdir = NULL;
|
||||||
} else if (t_to->team->_aspace_id < 0) {
|
} else if (t_to->team->_aspace_id < 0) {
|
||||||
// the one we're switching to is kspace
|
// the one we're switching to is kspace
|
||||||
new_pgdir = vm_translation_map_get_pgdir(&t_to->team->kaspace->translation_map);
|
new_pgdir = i386_translation_map_get_pgdir(&t_to->team->kaspace->translation_map);
|
||||||
} else {
|
} else {
|
||||||
new_pgdir = vm_translation_map_get_pgdir(&t_to->team->aspace->translation_map);
|
new_pgdir = i386_translation_map_get_pgdir(&t_to->team->aspace->translation_map);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((new_pgdir % PAGE_SIZE) != 0)
|
if (((uint32)new_pgdir % PAGE_SIZE) != 0)
|
||||||
panic("arch_thread_context_switch: bad pgdir 0x%lx\n", new_pgdir);
|
panic("arch_thread_context_switch: bad pgdir 0x%lx\n", new_pgdir);
|
||||||
|
|
||||||
i386_fsave_swap(t_from->arch_info.fpu_state, t_to->arch_info.fpu_state);
|
i386_fsave_swap(t_from->arch_info.fpu_state, t_to->arch_info.fpu_state);
|
||||||
i386_context_switch(&t_from->arch_info, &t_to->arch_info, new_pgdir);
|
i386_context_switch(&t_from->arch_info, &t_to->arch_info, (addr)new_pgdir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -253,7 +254,7 @@ arch_setup_signal_frame(struct thread *t, struct sigaction *sa, int sig, int sig
|
|||||||
|
|
||||||
if (frame->orig_eax >= 0) {
|
if (frame->orig_eax >= 0) {
|
||||||
// we're coming from a syscall
|
// we're coming from a syscall
|
||||||
if ((frame->eax == EINTR) && (sa->sa_flags & SA_RESTART)) {
|
if (((status_t)frame->eax == EINTR) && (sa->sa_flags & SA_RESTART)) {
|
||||||
dprintf("### restarting syscall %d after signal %d\n", frame->orig_eax, sig);
|
dprintf("### restarting syscall %d after signal %d\n", frame->orig_eax, sig);
|
||||||
frame->eax = frame->orig_eax;
|
frame->eax = frame->orig_eax;
|
||||||
frame->edx = frame->orig_edx;
|
frame->edx = frame->orig_edx;
|
||||||
@ -273,7 +274,8 @@ arch_setup_signal_frame(struct thread *t, struct sigaction *sa, int sig, int sig
|
|||||||
stack_ptr[4] = sig_mask; // Old signal mask to restore
|
stack_ptr[4] = sig_mask; // Old signal mask to restore
|
||||||
stack_ptr[5] = (uint32)regs_ptr; // Int frame + extra regs to restore
|
stack_ptr[5] = (uint32)regs_ptr; // Int frame + extra regs to restore
|
||||||
|
|
||||||
memcpy(code_ptr, i386_return_from_signal, (i386_end_return_from_signal - i386_return_from_signal));
|
memcpy(code_ptr, i386_return_from_signal,
|
||||||
|
((uint32)i386_end_return_from_signal - (uint32)i386_return_from_signal));
|
||||||
|
|
||||||
regs = (struct vregs *)regs_ptr;
|
regs = (struct vregs *)regs_ptr;
|
||||||
regs->eip = frame->eip;
|
regs->eip = frame->eip;
|
||||||
@ -335,7 +337,7 @@ arch_check_syscall_restart(struct thread *t)
|
|||||||
{
|
{
|
||||||
struct iframe *frame = t->arch_info.current_iframe;
|
struct iframe *frame = t->arch_info.current_iframe;
|
||||||
|
|
||||||
if ((frame->orig_eax >= 0) && (frame->eax == EINTR)) {
|
if (((status_t)frame->orig_eax >= 0) && ((status_t)frame->eax == EINTR)) {
|
||||||
frame->eax = frame->orig_eax;
|
frame->eax = frame->orig_eax;
|
||||||
frame->edx = frame->orig_edx;
|
frame->edx = frame->orig_edx;
|
||||||
frame->eip -= 2;
|
frame->eip -= 2;
|
||||||
|
@ -864,9 +864,9 @@ vm_translation_map_quick_query(addr va, addr *out_physical)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
addr
|
void *
|
||||||
vm_translation_map_get_pgdir(vm_translation_map *map)
|
i386_translation_map_get_pgdir(vm_translation_map *map)
|
||||||
{
|
{
|
||||||
return (addr)map->arch_data->pgdir_phys;
|
return map->arch_data->pgdir_phys;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user