示例#1
0
void sig_handler(ARCH_SIGHDLR_PARAM)
{
	struct sigcontext *sc;
	int enabled;

	/* Must be the first thing that this handler does - x86_64 stores
	 * the sigcontext in %rdx, and we need to save it before it has a
	 * chance to get trashed.
	 */

	ARCH_GET_SIGCONTEXT(sc, sig);

	enabled = signals_enabled;
	if(!enabled && (sig == SIGIO)){
		pending |= SIGIO_MASK;
		return;
	}

	block_signals();

	CHOOSE_MODE_PROC(sig_handler_common_tt, sig_handler_common_skas,
			 sig, sc);

	set_signals(enabled);
}
示例#2
0
void sig_handler(int sig)
{
	struct sigcontext *sc;

	ARCH_GET_SIGCONTEXT(sc, sig);
	CHOOSE_MODE_PROC(sig_handler_common_tt, sig_handler_common_skas,
			 sig, sc);
}
示例#3
0
void alarm_handler(int sig, struct sigcontext sc)
{
	if(!timer_irq_inited) return;

	if(sig == SIGALRM)
		switch_timers(0);

	CHOOSE_MODE_PROC(sig_handler_common_tt, sig_handler_common_skas,
			 sig, &sc);

	if(sig == SIGALRM)
		switch_timers(1);
}
示例#4
0
void alarm_handler(int sig)
{
	struct sigcontext *sc;

	ARCH_GET_SIGCONTEXT(sc, sig);
	if(!timer_irq_inited) return;

	if(sig == SIGALRM)
		switch_timers(0);

	CHOOSE_MODE_PROC(sig_handler_common_tt, sig_handler_common_skas,
			 sig, sc);

	if(sig == SIGALRM)
		switch_timers(1);
}
示例#5
0
static void real_alarm_handler(int sig, struct sigcontext *sc)
{
	if(!timer_irq_inited){
		signals_enabled = 1;
		return;
	}

	if(sig == SIGALRM)
		switch_timers(0);

	CHOOSE_MODE_PROC(sig_handler_common_tt, sig_handler_common_skas,
			 sig, sc);

	if(sig == SIGALRM)
		switch_timers(1);

}
示例#6
0
unsigned long thread_saved_pc(struct task_struct *task)
{
	return(os_process_pc(CHOOSE_MODE_PROC(thread_pid_tt, thread_pid_skas,
					      task)));
}
示例#7
0
int linux_main(int argc, char **argv)
{
	unsigned long avail, diff;
	unsigned long virtmem_size, max_physmem;
	unsigned int i, add;

	for (i = 1; i < argc; i++){
		if((i == 1) && (argv[i][0] == ' ')) continue;
		add = 1;
		uml_checksetup(argv[i], &add);
		if(add) add_arg(saved_command_line, argv[i]);
	}
	if(have_root == 0) add_arg(saved_command_line, DEFAULT_COMMAND_LINE);

	mode_tt = force_tt ? 1 : !can_do_skas();
#ifndef CONFIG_MODE_TT
	if (mode_tt) {
		/*Since CONFIG_MODE_TT is #undef'ed, force_tt cannot be 1. So,
		 * can_do_skas() returned 0, and the message is correct. */
		printf("Support for TT mode is disabled, and no SKAS support is present on the host.\n");
		exit(1);
	}
#endif
	uml_start = CHOOSE_MODE_PROC(set_task_sizes_tt, set_task_sizes_skas, 0,
				     &host_task_size, &task_size);

	/* Need to check this early because mmapping happens before the
	 * kernel is running.
	 */
	check_tmpexec();

	brk_start = (unsigned long) sbrk(0);
	CHOOSE_MODE_PROC(before_mem_tt, before_mem_skas, brk_start);
	/* Increase physical memory size for exec-shield users
	so they actually get what they asked for. This should
	add zero for non-exec shield users */

	diff = UML_ROUND_UP(brk_start) - UML_ROUND_UP(&_end);
	if(diff > 1024 * 1024){
		printf("Adding %ld bytes to physical memory to account for "
		       "exec-shield gap\n", diff);
		physmem_size += UML_ROUND_UP(brk_start) - UML_ROUND_UP(&_end);
	}

	uml_physmem = uml_start;

	/* Reserve up to 4M after the current brk */
	uml_reserved = ROUND_4M(brk_start) + (1 << 22);

	setup_machinename(system_utsname.machine);

#ifdef CONFIG_MODE_TT
	argv1_begin = argv[1];
	argv1_end = &argv[1][strlen(argv[1])];
#endif
  
	highmem = 0;
	iomem_size = (iomem_size + PAGE_SIZE - 1) & PAGE_MASK;
	max_physmem = get_kmem_end() - uml_physmem - iomem_size - MIN_VMALLOC;

	/* Zones have to begin on a 1 << MAX_ORDER page boundary,
	 * so this makes sure that's true for highmem
	 */
	max_physmem &= ~((1 << (PAGE_SHIFT + MAX_ORDER)) - 1);
	if(physmem_size + iomem_size > max_physmem){
		highmem = physmem_size + iomem_size - max_physmem;
		physmem_size -= highmem;
#ifndef CONFIG_HIGHMEM
		highmem = 0;
		printf("CONFIG_HIGHMEM not enabled - physical memory shrunk "
		       "to %ld bytes\n", physmem_size);
#endif
	}

	high_physmem = uml_physmem + physmem_size;
	end_iomem = high_physmem + iomem_size;
	high_memory = (void *) end_iomem;

	start_vm = VMALLOC_START;

	setup_physmem(uml_physmem, uml_reserved, physmem_size, highmem);
	if(init_maps(physmem_size, iomem_size, highmem)){
		printf("Failed to allocate mem_map for %ld bytes of physical "
		       "memory and %ld bytes of highmem\n", physmem_size,
		       highmem);
		exit(1);
	}

	virtmem_size = physmem_size;
	avail = get_kmem_end() - start_vm;
	if(physmem_size > avail) virtmem_size = avail;
	end_vm = start_vm + virtmem_size;

	if(virtmem_size < physmem_size)
		printf("Kernel virtual memory size shrunk to %ld bytes\n",
		       virtmem_size);

  	uml_postsetup();

	task_protections((unsigned long) &init_thread_info);
	os_flush_stdout();

	return(CHOOSE_MODE(start_uml_tt(), start_uml_skas()));
}
示例#8
0
void sig_handler(int sig, struct sigcontext sc)
{
	CHOOSE_MODE_PROC(sig_handler_common_tt, sig_handler_common_skas,
			 sig, &sc);
}
示例#9
0
void start_thread(struct pt_regs *regs, unsigned long eip, unsigned long esp)
{
	CHOOSE_MODE_PROC(start_thread_tt, start_thread_skas, regs, eip, esp);
}
示例#10
0
文件: process.c 项目: cilynx/dd-wrt
static inline int external_pid(struct task_struct *task)
{
	return CHOOSE_MODE_PROC(external_pid_tt, external_pid_skas, task);
}
示例#11
0
文件: tlb.c 项目: 12019/hg556a_source
void flush_tlb_mm(struct mm_struct *mm)
{
	CHOOSE_MODE_PROC(flush_tlb_mm_tt, flush_tlb_mm_skas, mm);
}
示例#12
0
文件: tlb.c 项目: 12019/hg556a_source
void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, 
		     unsigned long end)
{
	CHOOSE_MODE_PROC(flush_tlb_range_tt, flush_tlb_range_skas, vma, start, 
			 end);
}
示例#13
0
文件: tlb.c 项目: 12019/hg556a_source
void __flush_tlb_one(unsigned long addr)
{
	CHOOSE_MODE_PROC(__flush_tlb_one_tt, __flush_tlb_one_skas, addr);
}
示例#14
0
文件: tlb.c 项目: 12019/hg556a_source
void flush_tlb_kernel_range(unsigned long start, unsigned long end)
{
	CHOOSE_MODE_PROC(flush_tlb_kernel_range_tt, 
			 flush_tlb_kernel_range_skas, start, end);
}