blob: 606bb5c7fdf6a2714d68111cf96c0c7a72eed012 [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
Jeff Dike54ae36f2007-10-16 01:27:33 -07009#include "uml-config.h"
10#include "kern_constants.h"
11
12/*
Jeff Dike4bdf8bc2008-02-04 22:30:44 -080013 * Stolen from linux/const.h, which can't be directly included since
14 * this is used in userspace code, which has no access to the kernel
15 * headers. Changed to be suitable for adding casts to the start,
16 * rather than "UL" to the end.
Jeff Dike54ae36f2007-10-16 01:27:33 -070017 */
Jeff Dike54ae36f2007-10-16 01:27:33 -070018
Jeff Dike4bdf8bc2008-02-04 22:30:44 -080019/* Some constant macros are used in both assembler and
20 * C code. Therefore we cannot annotate them always with
21 * 'UL' and other type specifiers unilaterally. We
22 * use the following macros to deal with this.
Jeff Dike54ae36f2007-10-16 01:27:33 -070023 */
Jeff Dike4bdf8bc2008-02-04 22:30:44 -080024
25#ifdef __ASSEMBLY__
26#define _AC(X, Y) (Y)
27#else
28#define __AC(X, Y) (X (Y))
29#define _AC(X, Y) __AC(X, Y)
30#endif
31
Jeff Dike39633332008-02-04 22:31:01 -080032#define STUB_START _AC(, 0x100000)
33#define STUB_CODE _AC((unsigned long), STUB_START)
34#define STUB_DATA _AC((unsigned long), STUB_CODE + UM_KERN_PAGE_SIZE)
35#define STUB_END _AC((unsigned long), STUB_DATA + UM_KERN_PAGE_SIZE)
Jeff Dike4bdf8bc2008-02-04 22:30:44 -080036
Jeff Dike54ae36f2007-10-16 01:27:33 -070037#ifndef __ASSEMBLY__
38
Jeff Dike4ff83ce2007-05-06 14:51:08 -070039#include "sysdep/ptrace.h"
40
41struct cpu_task {
42 int pid;
43 void *task;
44};
45
46extern struct cpu_task cpu_tasks[];
47
48extern unsigned long low_physmem;
49extern unsigned long high_physmem;
50extern unsigned long uml_physmem;
51extern unsigned long uml_reserved;
52extern unsigned long end_vm;
53extern unsigned long start_vm;
54extern unsigned long long highmem;
55
56extern unsigned long _stext, _etext, _sdata, _edata, __bss_start, _end;
57extern unsigned long _unprotected_end;
58extern unsigned long brk_start;
59
60extern int linux_main(int argc, char **argv);
Jeff Dike4ff83ce2007-05-06 14:51:08 -070061
Jeff Dike77bf4402007-10-16 01:26:58 -070062extern void (*sig_info[])(int, struct uml_pt_regs *);
Jeff Dike4ff83ce2007-05-06 14:51:08 -070063
64#endif
Jeff Dike54ae36f2007-10-16 01:27:33 -070065
66#endif