Jeff Dike | 4ff83ce | 2007-05-06 14:51:08 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) |
| 3 | * Licensed under the GPL |
| 4 | */ |
| 5 | |
| 6 | #ifndef __START_H__ |
| 7 | #define __START_H__ |
| 8 | |
Al Viro | 9e63645 | 2011-08-18 20:01:49 +0100 | [diff] [blame] | 9 | #include <generated/asm-offsets.h> |
Jeff Dike | 54ae36f | 2007-10-16 01:27:33 -0700 | [diff] [blame] | 10 | |
| 11 | /* |
Jeff Dike | 4bdf8bc | 2008-02-04 22:30:44 -0800 | [diff] [blame] | 12 | * Stolen from linux/const.h, which can't be directly included since |
| 13 | * this is used in userspace code, which has no access to the kernel |
| 14 | * headers. Changed to be suitable for adding casts to the start, |
| 15 | * rather than "UL" to the end. |
Jeff Dike | 54ae36f | 2007-10-16 01:27:33 -0700 | [diff] [blame] | 16 | */ |
Jeff Dike | 54ae36f | 2007-10-16 01:27:33 -0700 | [diff] [blame] | 17 | |
Jeff Dike | 4bdf8bc | 2008-02-04 22:30:44 -0800 | [diff] [blame] | 18 | /* Some constant macros are used in both assembler and |
| 19 | * C code. Therefore we cannot annotate them always with |
| 20 | * 'UL' and other type specifiers unilaterally. We |
| 21 | * use the following macros to deal with this. |
Jeff Dike | 54ae36f | 2007-10-16 01:27:33 -0700 | [diff] [blame] | 22 | */ |
Jeff Dike | 4bdf8bc | 2008-02-04 22:30:44 -0800 | [diff] [blame] | 23 | |
| 24 | #ifdef __ASSEMBLY__ |
Cyrill Gorcunov | a7dfa94 | 2008-05-12 14:01:56 -0700 | [diff] [blame] | 25 | #define _UML_AC(X, Y) (Y) |
Jeff Dike | 4bdf8bc | 2008-02-04 22:30:44 -0800 | [diff] [blame] | 26 | #else |
Cyrill Gorcunov | a7dfa94 | 2008-05-12 14:01:56 -0700 | [diff] [blame] | 27 | #define __UML_AC(X, Y) (X(Y)) |
| 28 | #define _UML_AC(X, Y) __UML_AC(X, Y) |
Jeff Dike | 4bdf8bc | 2008-02-04 22:30:44 -0800 | [diff] [blame] | 29 | #endif |
| 30 | |
Cyrill Gorcunov | a7dfa94 | 2008-05-12 14:01:56 -0700 | [diff] [blame] | 31 | #define STUB_START _UML_AC(, 0x100000) |
| 32 | #define STUB_CODE _UML_AC((unsigned long), STUB_START) |
| 33 | #define STUB_DATA _UML_AC((unsigned long), STUB_CODE + UM_KERN_PAGE_SIZE) |
| 34 | #define STUB_END _UML_AC((unsigned long), STUB_DATA + UM_KERN_PAGE_SIZE) |
Jeff Dike | 4bdf8bc | 2008-02-04 22:30:44 -0800 | [diff] [blame] | 35 | |
Jeff Dike | 54ae36f | 2007-10-16 01:27:33 -0700 | [diff] [blame] | 36 | #ifndef __ASSEMBLY__ |
| 37 | |
Jeff Dike | 4ff83ce | 2007-05-06 14:51:08 -0700 | [diff] [blame] | 38 | #include "sysdep/ptrace.h" |
| 39 | |
| 40 | struct cpu_task { |
| 41 | int pid; |
| 42 | void *task; |
| 43 | }; |
| 44 | |
| 45 | extern struct cpu_task cpu_tasks[]; |
| 46 | |
| 47 | extern unsigned long low_physmem; |
| 48 | extern unsigned long high_physmem; |
| 49 | extern unsigned long uml_physmem; |
| 50 | extern unsigned long uml_reserved; |
| 51 | extern unsigned long end_vm; |
| 52 | extern unsigned long start_vm; |
| 53 | extern unsigned long long highmem; |
| 54 | |
| 55 | extern unsigned long _stext, _etext, _sdata, _edata, __bss_start, _end; |
| 56 | extern unsigned long _unprotected_end; |
| 57 | extern unsigned long brk_start; |
| 58 | |
Jeff Dike | 536788f | 2008-02-08 04:22:07 -0800 | [diff] [blame] | 59 | extern unsigned long host_task_size; |
| 60 | |
Jeff Dike | 4ff83ce | 2007-05-06 14:51:08 -0700 | [diff] [blame] | 61 | extern int linux_main(int argc, char **argv); |
Jeff Dike | 4ff83ce | 2007-05-06 14:51:08 -0700 | [diff] [blame] | 62 | |
Martin Pärtel | d3c1cfc | 2012-08-02 00:49:17 +0200 | [diff] [blame] | 63 | struct siginfo; |
| 64 | extern void (*sig_info[])(int, struct siginfo *si, struct uml_pt_regs *); |
Jeff Dike | 4ff83ce | 2007-05-06 14:51:08 -0700 | [diff] [blame] | 65 | |
| 66 | #endif |
Jeff Dike | 54ae36f | 2007-10-16 01:27:33 -0700 | [diff] [blame] | 67 | |
| 68 | #endif |