blob: 86daa546181568fb10b860c76f428b1f1a12dc47 [file] [log] [blame]
Jeff Dike4ff83ce2007-05-06 14:51:08 -07001/*
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 Viro9e636452011-08-18 20:01:49 +01009#include <generated/asm-offsets.h>
Jeff Dike54ae36f2007-10-16 01:27:33 -070010
11/*
Jeff Dike4bdf8bc2008-02-04 22:30:44 -080012 * 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 Dike54ae36f2007-10-16 01:27:33 -070016 */
Jeff Dike54ae36f2007-10-16 01:27:33 -070017
Jeff Dike4bdf8bc2008-02-04 22:30:44 -080018/* 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 Dike54ae36f2007-10-16 01:27:33 -070022 */
Jeff Dike4bdf8bc2008-02-04 22:30:44 -080023
24#ifdef __ASSEMBLY__
Cyrill Gorcunova7dfa942008-05-12 14:01:56 -070025#define _UML_AC(X, Y) (Y)
Jeff Dike4bdf8bc2008-02-04 22:30:44 -080026#else
Cyrill Gorcunova7dfa942008-05-12 14:01:56 -070027#define __UML_AC(X, Y) (X(Y))
28#define _UML_AC(X, Y) __UML_AC(X, Y)
Jeff Dike4bdf8bc2008-02-04 22:30:44 -080029#endif
30
Cyrill Gorcunova7dfa942008-05-12 14:01:56 -070031#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 Dike4bdf8bc2008-02-04 22:30:44 -080035
Jeff Dike54ae36f2007-10-16 01:27:33 -070036#ifndef __ASSEMBLY__
37
Jeff Dike4ff83ce2007-05-06 14:51:08 -070038#include "sysdep/ptrace.h"
39
40struct cpu_task {
41 int pid;
42 void *task;
43};
44
45extern struct cpu_task cpu_tasks[];
46
47extern unsigned long low_physmem;
48extern unsigned long high_physmem;
49extern unsigned long uml_physmem;
50extern unsigned long uml_reserved;
51extern unsigned long end_vm;
52extern unsigned long start_vm;
53extern unsigned long long highmem;
54
55extern unsigned long _stext, _etext, _sdata, _edata, __bss_start, _end;
56extern unsigned long _unprotected_end;
57extern unsigned long brk_start;
58
Jeff Dike536788f2008-02-08 04:22:07 -080059extern unsigned long host_task_size;
60
Jeff Dike4ff83ce2007-05-06 14:51:08 -070061extern int linux_main(int argc, char **argv);
Jeff Dike4ff83ce2007-05-06 14:51:08 -070062
Martin Pärteld3c1cfc2012-08-02 00:49:17 +020063struct siginfo;
64extern void (*sig_info[])(int, struct siginfo *si, struct uml_pt_regs *);
Jeff Dike4ff83ce2007-05-06 14:51:08 -070065
66#endif
Jeff Dike54ae36f2007-10-16 01:27:33 -070067
68#endif