xref: /linux/arch/powerpc/include/asm/user.h (revision 4f2c0a4acffbec01079c28f839422e64ddeff004)
1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
2dd56fdf2Sjdl@freescale.com #ifndef _ASM_POWERPC_USER_H
3dd56fdf2Sjdl@freescale.com #define _ASM_POWERPC_USER_H
4dd56fdf2Sjdl@freescale.com 
5dd56fdf2Sjdl@freescale.com #include <asm/ptrace.h>
61da177e4SLinus Torvalds #include <asm/page.h>
71da177e4SLinus Torvalds 
81da177e4SLinus Torvalds /*
9dd56fdf2Sjdl@freescale.com  * Adapted from <asm-alpha/user.h>
10dd56fdf2Sjdl@freescale.com  *
111da177e4SLinus Torvalds  * Core file format: The core file is written in such a way that gdb
121da177e4SLinus Torvalds  * can understand it and provide useful information to the user (under
131da177e4SLinus Torvalds  * linux we use the `trad-core' bfd, NOT the osf-core).  The file contents
141da177e4SLinus Torvalds  * are as follows:
151da177e4SLinus Torvalds  *
161da177e4SLinus Torvalds  *  upage: 1 page consisting of a user struct that tells gdb
171da177e4SLinus Torvalds  *	what is present in the file.  Directly after this is a
181da177e4SLinus Torvalds  *	copy of the task_struct, which is currently not used by gdb,
191da177e4SLinus Torvalds  *	but it may come in handy at some point.  All of the registers
201da177e4SLinus Torvalds  *	are stored as part of the upage.  The upage should always be
211da177e4SLinus Torvalds  *	only one page long.
221da177e4SLinus Torvalds  *  data: The data segment follows next.  We use current->end_text to
231da177e4SLinus Torvalds  *	current->brk to pick up all of the user variables, plus any memory
241da177e4SLinus Torvalds  *	that may have been sbrk'ed.  No attempt is made to determine if a
251da177e4SLinus Torvalds  *	page is demand-zero or if a page is totally unused, we just cover
261da177e4SLinus Torvalds  *	the entire range.  All of the addresses are rounded in such a way
271da177e4SLinus Torvalds  *	that an integral number of pages is written.
281da177e4SLinus Torvalds  *  stack: We need the stack information in order to get a meaningful
291da177e4SLinus Torvalds  *	backtrace.  We need to write the data from usp to
301da177e4SLinus Torvalds  *	current->start_stack, so we round each of these in order to be able
311da177e4SLinus Torvalds  *	to write an integer number of pages.
321da177e4SLinus Torvalds  */
331da177e4SLinus Torvalds struct user {
34*6ce7bff0SMichael Ellerman 	struct user_pt_regs regs;		/* entire machine state */
351da177e4SLinus Torvalds 	size_t		u_tsize;		/* text size (pages) */
361da177e4SLinus Torvalds 	size_t		u_dsize;		/* data size (pages) */
371da177e4SLinus Torvalds 	size_t		u_ssize;		/* stack size (pages) */
381da177e4SLinus Torvalds 	unsigned long	start_code;		/* text starting address */
391da177e4SLinus Torvalds 	unsigned long	start_data;		/* data starting address */
401da177e4SLinus Torvalds 	unsigned long	start_stack;		/* stack starting address */
411da177e4SLinus Torvalds 	long int	signal;			/* signal causing core dump */
426e16d89bSH. Peter Anvin 	unsigned long	u_ar0;			/* help gdb find registers */
431da177e4SLinus Torvalds 	unsigned long	magic;			/* identifies a core file */
441da177e4SLinus Torvalds 	char		u_comm[32];		/* user command name */
451da177e4SLinus Torvalds };
461da177e4SLinus Torvalds 
47dd56fdf2Sjdl@freescale.com #endif	/* _ASM_POWERPC_USER_H */
48