The Datasheet Archive - 100 Million Datasheets from 7500 Manufacturers.    


Datasheet Search Engine   
 
Part # or Description: • 5V RS232 Driver • 2SC5066* • "Real Time Clock" • "USB connector" • "blue led" 5mm • 10 watt zener diode • 2N3055* motorola
 
Search Tip: Try entering the part number only. Include a wildcard (eg. lm317* or 1n4148*)

 

 

access time modification time Figure 6-52 #define


Datasheet Thumbnail

  

Download PDF



Top Searches for this datasheet



struct utimbuf time_t actime; time_t modtime;
access time modification time
Figure 6-52 <utime.h>
#define
_SYS_NMLN
struct utsname char sysname[_SYS_NMLN]; char nodename[_SYS_NMLN]; char release[_SYS_NMLN]; char version[_SYS_NMLN]; char machine[_SYS_NMLN];
Figure 6-53 <sys/utsname.h>
#define #define #define #define #define #define #define #define
WUNTRACED 0004 WNOHANG 0100 WEXITED 0001 WTRAPPED 0002 WSTOPPED WUNTRACED WCONTINUED 0010 WNOWAIT 0200 WOPTMASK WSTOPFLG WCONTFLG WCOREFLG WSIGMASK 0177 0177777 0200 0177
#define #define #define #define
Figure 6-54 <wait.h>
6-56
PowerPC Processor Supplement-September 1995
#define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define
_SC_MQ_OPEN_MAX _SC_MQ_PRIO_MAX _SC_PRIORITIZED_IO _SC_PRIORITY_SCHEDULING _SC_REALTIME_SIGNALS _SC_RTSIG_MAX _SC_SEMAPHORES _SC_SEM_NSEMS_MAX _SC_SEM_VALUE_MAX _SC_SHARED_MEMORY_OBJECTS _SC_SIGQUEUE_MAX _SC_SIGRT_MIN _SC_SIGRT_MAX _SC_SYNCHRONIZED_IO _SC_TIMERS _SC_TIMER_MAX _SC_2_C_BIND _SC_2_C_DEV _SC_2_C_VERSION _SC_2_FORT_DEV _SC_2_FORT_RUN _SC_2_LOCALEDEF _SC_2_SW_DEV _SC_2_UPE _SC_2_VERSION _SC_BC_BASE_MAX _SC_BC_DIM_MAX _SC_BC_SCALE_MAX _SC_BC_STRING_MAX _SC_COLL_WEIGHTS_MAX _SC_EXPR_NEST_MAX _SC_LINE_MAX _SC_RE_DUP_MAX _SC_XOPEN_CRYPT _SC_XOPEN_ENH_I18N _SC_XOPEN_SHM _SC_PHYS_PAGES _SC_AVPHYS_PAGES _CS_PATH _PC_LINK_MAX _PC_MAX_CANON _PC_MAX_INPUT _PC_NAME_MAX _PC_PATH_MAX _PC_PIPE_BUF _PC_NO_TRUNC _PC_VDISABLE _PC_CHOWN_RESTRICTED _PC_ASYNC_IO _PC_PRIO_IO _PC_SYNC_IO _PC_LAST
Figure 6-51 <unistd.h>
Libraries
6-55
#define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define
R_OK W_OK X_OK F_OK
Test Test Test Test
Read permission Write permission eXecute permission existence File
F_ULOCK F_LOCK F_TLOCK F_TEST SEEK_SET SEEK_CUR SEEK_END
Unlock previously locked region Lock region exclusive Test lock region excl Test region other procs locks file pointer "offset" current plus "offset" plus "offset"
_POSIX_FSYNC _POSIX_JOB_CONTROL _POSIX_MAPPED_FILES _POSIX_MEMLOCK _POSIX_MEMLOCK_RANGE _POSIX_MEMORY_PROTECTION _POSIX_REALTIME_SIGNALS _POSIX_SAVED_IDS _POSIX_SYNCHRONIZED_IO _POSIX_TIMERS _POSIX_VDISABLE
#define STDIN_FILENO #define STDOUT_FILENO #define STDERR_FILENO #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define _SC_ARG_MAX _SC_CHILD_MAX _SC_CLK_TCK _SC_NGROUPS_MAX _SC_OPEN_MAX _SC_JOB_CONTROL _SC_SAVED_IDS _SC_VERSION _SC_PASS_MAX _SC_LOGNAME_MAX _SC_PAGESIZE _SC_XOPEN_VERSION _SC_NPROCESSORS_CONF _SC_NPROCESSORS_ONLN _SC_STREAM_MAX _SC_TZNAME_MAX _SC_AIO_LISTIO_MAX _SC_AIO_MAX _SC_AIO_PRIO_DELTA_MAX _SC_ASYNCHRONOUS_IO _SC_DELAYTIMER_MAX _SC_FSYNC _SC_MAPPED_FILES _SC_MEMLOCK _SC_MEMLOCK_RANGE _SC_MEMORY_PROTECTION _SC_MESSAGE_PASSING
6-54
PowerPC Processor Supplement-September 1995
greg_t greg_t greg_t greg_t greg_t greg_t greg_t greg_t greg_t greg_t greg_t
r_r28; r_r29; r_r30; r_r31; r_cr; r_lr; r_pc; r_msr; r_ctr; r_xer; r_mq;
Condition Register Link Register User (Copy SRR0) saved (Copy SRR1) Count Register Integer Exception Register Register (601 only)
typedef struct double fpu_regs[32]; regs doubles unsigned fpu_fpscr; status/control unsigned fpu_valid; nonzero rest this structure contains valid data fpregset_t; typedef struct gregset_t fpregset_t long mcontext_t; #define FP_NO #define FP_HW
gregs; general register fpregs; floating point register filler[8];
chip emulator support) processor present kind support exists
extern fp_version; extern fpu_exists;
Figure 6-48 <ucontext.h>
typedef struct iovec caddr_t iov_base; iov_len; iovec_t;
Figure 6-49 <sys/uio.h>
#define UL_GETFSIZE #define UL_SETFSIZE
file limit file limit
Figure 6-50
<ulimit.h>
Libraries
6-53
typedef struct ucontext unsigned long struct ucontext sigset_t stack_t mcontext_t long ucontext_t; #define GETCONTEXT #define SETCONTEXT #define #define #define #define #define #define UC_SIGMASK UC_STACK UC_CPU UC_MAU UC_FPU UC_INTR
uc_flags; *uc_link; uc_sigmask; uc_stack; uc_mcontext; uc_filler[6];
UC_MAU (UC_CPU|UC_FPU)
#define UC_MCONTEXT #define UC_ALL #define NGREG typedef typedef greg_t struct regs greg_t greg_t greg_t greg_t greg_t greg_t greg_t greg_t greg_t greg_t greg_t greg_t greg_t greg_t greg_t greg_t greg_t greg_t greg_t greg_t greg_t greg_t greg_t greg_t greg_t greg_t greg_t greg_t
greg_t; gregset_t[NGREG];
r_r0; r_r1; r_r2; r_r3; r_r4; r_r5; r_r6; r_r7; r_r8; r_r9; r_r10; r_r11; r_r12; r_r13; r_r14; r_r15; r_r16; r_r17; r_r18; r_r19; r_r20; r_r21; r_r22; r_r23; r_r24; r_r25; r_r26; r_r27;
GPRs
6-52
PowerPC Processor Supplement-September 1995
typedef typedef typedef typedef typedef typedef typedef typedef typedef typedef typedef
long long unsigned long unsigned long unsigned unsigned long long
long long
long long
time_t; daddr_t; dev_t; gid_t; ino_t; key_t; pid_t; mode_t; nlink_t; off_t; uid_t;
Figure 6-47 <sys/types.h>
Libraries
6-51
#define T_FAKE #define T_HACK
fake state used when state cannot determined T_HACK useless exposed interface
#define T_NOSTATES #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define T_OPEN T_BIND T_OPTMGMT T_UNBIND T_CLOSE T_SNDUDATA T_RCVUDATA T_RCVUDERR T_CONNECT1 T_CONNECT2 T_RCVCONNECT T_LISTN T_ACCEPT1 T_ACCEPT2 T_ACCEPT3 T_SND T_RCV T_SNDDIS1 T_SNDDIS2 T_RCVDIS1 T_RCVDIS2 T_RCVDIS3 T_SNDREL T_RCVREL T_PASSCON
valid state change
#define T_NOEVENTS #define
extern char #define LOCALNAME #define REMOTENAME #define TI_NORMAL #define TI_EXPEDITED
extern char *t_errlist[]; extern t_nerr;
Figure 6-46 <sys/tiuser.h>
6-50
PowerPC Processor Supplement-September 1995
struct t_bind struct netbuf unsigned struct t_optmgmt struct netbuf long
addr; qlen;
opt; flags;
struct t_discon struct netbuf udata; reason; sequence; struct t_call struct netbuf addr; struct netbuf opt; struct netbuf udata; sequence; struct t_unitdata struct netbuf addr; struct netbuf opt; struct netbuf udata; struct t_uderr struct netbuf addr; struct netbuf opt; long error; #define #define #define #define #define #define #define #define #define #define #define T_BIND T_OPTMGMT T_CALL T_DIS T_UNITDATA T_UDERROR T_INFO T_ADDR T_OPT T_UDATA T_ALL 0x01 0x02 0x04 0x07
user data reason code sequence number
address options user data sequence number
address options user data
address options error code
struct struct struct struct struct struct struct
t_bind t_optmgmt t_call t_discon t_unitdata t_uderr t_info
address options user data above
#define #define #define #define #define #define #define #define
T_UNINIT T_UNBND T_IDLE T_OUTCON T_INCON T_DATAXFER T_OUTREL T_INREL
uninitialized unbound idle outgoing connection pending incoming connection pending data transfer outgoing release pending incoming release pending
Libraries
6-49
#define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define
TBADADDR TBADOPT TACCES TBADF TNOADDR TOUTSTATE TBADSEQ TSYSERR TLOOK TBADDATA TBUFOVFLW TFLOW TNODATA TNODIS TNOUDERR TBADFLAG TNOREL TNOTSUPPORT TSTATECHNG T_LISTEN T_CONNECT T_DATA T_EXDATA T_DISCONNECT T_ERROR T_UDERR T_ORDREL T_EVENTS T_MORE T_EXPEDITED T_NEGOTIATE T_CHECK T_DEFAULT T_SUCCESS T_FAILURE
0x0001 0x0002 0x0004 0x0008 0x0010 0x0020 0x0040 0x0080 0x00ff 0x001 0x002 0x004 0x008 0x010 0x020 0x040
incorrect addr format incorrect option format incorrect permissions illegal transport couldn't allocate addr state call sequence number system error event requires attention illegal amount data buffer large enough flow control data discon_ind found unitdata error found flags found primitive supported state changing connection indication rcvd connect confirmation rcvd normal data received expedited data received disconnect received fatal error occurred data gram error indication orderly release indication event mask more data expedited data opts check opts default opts successful failure
struct t_info long addr; size protocol address long options; size protocol options long tsdu; size transport service data unit long etsdu; size expedited tsdu long connect; data connection primitives long discon; data disconnect primitives long servtype; provider service type #define T_COTS connection oriented service #define T_COTS_ORD conn oriented w/orderly release #define T_CLTS connectionless transport service struct netbuf unsigned maxlen; unsigned len; char *buf;
6-48
PowerPC Processor Supplement-September 1995
typdef long clock_t; struct clock_t clock_t clock_t clock_t
tms_utime; tms_stime; tms_cutime; tms_cstime;
user time system time user time, children system time, children
Figure 6-45 <sys/times.h>
Libraries
6-47
struct timeval long tv_sec; long tv_usec; #define #define #define #define struct ITIMER_REAL ITIMER_VIRTUAL ITIMER_PROF ITIMER_REALPROF
seconds microseconds
itimerval struct timeval it_interval; struct timeval it_value;
timer interval current value
#define #define #define #define MILLISEC MICROSEC NANOSEC 1000 1000000 1000000000 real (clock wall) time user usage clock user system usage clock timer relative timer absolute
#define CLOCK_REALTIME #define CLOCK_VIRTUAL #define CLOCK_PROF #define TIMER_RELTIME #define TIMER_ABSTIME typedef struct time_t long timespec_t;
timespec definition POSIX.4 tv_sec; seconds tv_nsec; nanoseconds
typedef struct itimerspec definition POSIX.4 struct timespec it_interval;/* timer period struct timespec it_value; timer expiration itimerspec_t; struct
tm_sec; tm_min; tm_hour; tm_mday; tm_mon; tm_year; tm_wday; tm_yday; tm_isdst;
extern long timezone; extern daylight; extern char *tzname[2];
Figure 6-44 <sys/time.h>
6-46
PowerPC Processor Supplement-September 1995
#define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define
NOFLSH TOSTOP ECHOCTL ECHOPRT ECHOKE DEFECHO FLUSHO PENDIN IEXTEN _TIOC TCGETA TCSETA TCSETAW TCSETAF TCSBRK TCXONC TCFLSH TCGETS TCSETS TCSETSW TCSETSF
0000200 0000400 0001000 0002000 0004000 0010000 0020000 0040000 0100000 ('T'<<8) (_TIOC|1) (_TIOC|2) (_TIOC|3) (_TIOC|4) (_TIOC|5) (_TIOC|6) (_TIOC|7) (_TIOC|13) (_TIOC|14) (_TIOC|15) (_TIOC|16)
#define TCIFLUSH #define TCOFLUSH #define TCIOFLUSH #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define TCOOFF TCOON TCIOFF TCION B110 B134 B150 B200 B300 B600 B1200 B1800 B2400 B4800 B9600 B19200 B38400
Figure 6-43 <termios.h>
Libraries
6-45
#define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define
OLCUC ONLCR OCRNL ONOCR ONLRET OFILL OFDEL NLDLY CRDLY TABDLY TAB0 TAB1 TAB2 TAB3 XTABS BSDLY VTDLY FFDLY CBAUD CSIZE CSTOPB CREAD PARENB PARODD HUPCL CLOCAL RCV1EN XMT1EN LOBLK XCLUDE CRTSCTS CIBAUD PAREXT ISIG ICANON XCASE ECHO ECHOE ECHOK ECHONL
0000002 0000004 0000010 0000020 0000040 0000100 0000200 0000400 0000400 0003000 0001000 0002000 0003000 0014000 0004000 0010000 0014000 0014000 0020000 0020000 0040000 0040000 0100000 0100000 0000017 0000060 0000020 0000040 0000060 0000100 0000200 0000400 0001000 0002000 0004000 0010000 0020000 0040000 0100000 020000000000 03600000 04000000 0000001 0000002 0000004 0000010 0000020 0000040 0000100
6-44
PowerPC Processor Supplement-September 1995
#define #define NCCS #define CTRL(c) ((c)&037) #define IBSHIFT #define _POSIX_VDISABLE typedef unsigned long tcflag_t; typedef unsigned char cc_t; typedef unsigned long speed_t; Ioctl control packet struct termios tcflag_t c_iflag; tcflag_t c_oflag; tcflag_t c_cflag; tcflag_t c_lflag; cc_t c_cc[NCCS]; #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define VINTR VQUIT VERASE VKILL VEOF VEOL VEOL2 VMIN VTIME VSWTCH VSTART VSTOP VSUSP VDSUSP VREPRINT VDISCARD VWERASE VLNEXT IGNBRK BRKINT IGNPAR PARMRK INPCK ISTRIP INLCR IGNCR ICRNL IUCLC IXON IXANY IXOFF IMAXBEL OPOST 0000001 0000002 0000004 0000010 0000020 0000040 0000100 0000200 0000400 0001000 0002000 0004000 0010000 0020000 0000001
input modes output modes control modes line discipline modes control chars
Libraries
6-43
sl_nmods; struct str_mlist *sl_modlist; #define ANYMARK #define LASTMARK struct bandinfo unsigned char 0x01 0x02
bi_pri; bi_flag;
Figure 6-42 <stropts.h>
6-42
PowerPC Processor Supplement-September 1995
#define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define
I_SWROPT I_GWROPT I_LIST I_PLINK I_PUNLINK I_SETEV I_GETEV I_STREV I_UNSTREV I_FLUSHBAND I_CKBAND I_GETBAND I_ATMARK I_SETCLTIME I_GETCLTIME I_CANPUT
(STR|023) (STR|024) (STR|025) (STR|026) (STR|027) (STR|030) (STR|031) (STR|032) (STR|033) (STR|034) (STR|035) (STR|036) (STR|037) (STR|040) (STR|041) (STR|042)
struct strioctl char #define INFTIM
ic_cmd; ic_timout; ic_len; *ic_dp;
command timeout value length data pointer data
struct strbuf maxlen; len; char *buf; struct strpeek struct strbuf struct strbuf long struct strfdinsert struct strbuf struct strbuf long struct strrecvfd uid_t uid; gid_t gid; char fill[8]; struct str_mlist char l_name[FMNAMESZ+1]; struct str_list
bytes buffer bytes returned pointer data
ctlbuf; databuf; flags;
ctlbuf; databuf; flags; fildes; offset;
Libraries
6-41
#define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define
SNDZERO SNDPIPE RNORM RMSGD RMSGN RMODEMASK RPROTDAT RPROTDIS RPROTNORM RPROTMASK FLUSHR FLUSHW FLUSHRW FLUSHBAND S_INPUT S_HIPRI S_OUTPUT S_MSG S_ERROR S_HANGUP S_RDNORM S_WRNORM S_RDBAND S_WRBAND S_BANDURG RS_HIPRI MSG_HIPRI MSG_ANY MSG_BAND
0x001 0x002 0x000 0x001 0x002 0x003 0x004 0x008 0x010 0x01c 0x01 0x02 0x03 0x04 0x0001 0x0002 0x0004 0x0008 0x0010 0x0020 0x0040 S_OUTPUT 0x0080 0x0100 0x0200 0x01 0x01 0x02 0x04 (-1) ('S'<<8) (STR|01) (STR|02) (STR|03) (STR|04) (STR|05) (STR|06) (STR|07) (STR|010) (STR|011) (STR|012) (STR|013) (STR|014) (STR|015) (STR|016) (STR|017) (STR|020) (STR|021)
#define MORECTL #define MOREDATA #define MUXID_ALL #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define I_NREAD I_PUSH I_POP I_LOOK I_FLUSH I_SRDOPT I_GRDOPT I_STR I_SETSIG I_GETSIG I_FIND I_LINK I_UNLINK I_RECVFD I_PEEK I_FDINSERT I_SENDFD
6-40
PowerPC Processor Supplement-September 1995
#define BUFSIZ #define _NFILE #define #define #define #define #define _IOFBF _IOLBF _IONBF _IOEOF _IOERR
1024 0000 0100 0004 0020 0040 (-1) _NFILE 1024 "/var/tmp/" _iob[0]) _iob[1]) _iob[2])
#define #define FOPEN_MAX #define FILENAME_MAX #define L_ctermid #define L_cuserid #define P_tmpdir #define L_tmpnam #define stdin #define stdout #define stderr
typedef struct unsigned char unsigned char unsigned char unsigned char FILE; extern FILE
_cnt; *_ptr; *_base; _flag; _file;
number avail chars next char from/to here buffer state stream UNIX System file descriptor
_iob[_NFILE];
Figure 6-40 <stdio.h>
typedef struct quot; rem; div_t; typedef struct long quot; long rem; ldiv_t; #define EXIT_FAILURE #define EXIT_SUCCESS #define RAND_MAX extern unsigned char #define MB_CUR_MAX 32767 _ctype[512]; _ctype[520]
Figure 6-41 <stdlib.h>
Libraries
6-39
#define FSTYPSZ typedef struct statvfs unsigned long f_bsize; unsigned long f_frsize; unsigned long f_blocks; unsigned long f_bfree; unsigned long f_bavail; unsigned long f_files; unsigned long f_ffree; unsigned long f_favail; unsigned long f_fsid; char f_basetype[FSTYPSZ]; unsigned long f_flag; unsigned long f_namemax; char f_fstr[32]; unsigned long f_filler[16]; statvfs_t; #define ST_RDONLY #define ST_NOSUID 0x01 0x02 read-only file system does support setuid/setgid
Figure 6-38 <sys/statvfs.h>
#define typedef typedef typedef
NULL unsigned long
ptrdiff_t; size_t; wchar_t;
Figure 6-39 <stddef.h>
6-38
PowerPC Processor Supplement-September 1995
#define _ST_FSTYPSZ struct stat dev_t st_dev; long st_pad1[3]; ino_t st_ino; mode_t st_mode; nlink_t st_nlink; uid_t st_uid; gid_t st_gid; dev_t st_rdev; long st_pad2[2]; off_t st_size; long st_pad3; timestruc_t st_atim; timestruc_t st_mtim; timestruc_t st_ctim; long st_blksize; long st_blocks; char st_fstype[_ST_FSTYPSZ]; long st_pad4[8]; S_IFMT S_IFIFO S_IFCHR S_IFDIR S_IFBLK S_IFREG S_IFLNK S_IFSOCK S_ISUID S_ISGID S_ISVTX S_IREAD S_IWRITE S_IEXEC S_ENFMT S_IRWXU S_IRUSR S_IWUSR S_IXUSR S_IRWXG S_IRGRP S_IWGRP S_IXGRP S_IRWXO S_IROTH S_IWOTH S_IXOTH 0xF000 type file 0x1000 fifo 0x2000 character special 0x4000 directory 0x6000 block special 0x8000 regular 0xA000 symbolic link 0xC000 socket 0x800 user execution 0x400 group execution 0x200 save swapped text even after 00400 read permission, owner 00200 write permission, owner 00100 execute/search perm., owner S_ISGID record locking enforcement 00700 read, write, execute: owner 00400 read permission: owner 00200 write permission: owner 00100 execute permission: owner 00070 read, write, execute: group 00040 read permission: group 00020 write permission: group 00010 execute permission: group 00007 read, write, execute: other 00004 read permission: other 00002 write permission: other 00001 execute permission: other
#define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define
Figure 6-37 <sys/stat.h>
Libraries
6-37
clock_t _stime; _cld; _pdata; _proc; struct caddr_t _addr; _trapno; _fault; struct long _file;
_fd; _band;
struct caddr_t _faddr; timestruc_t _tstamp; short _syscall; char _nsysarg; char _fault; long _sysarg[8]; long _mstate[17]; _prof; _data; siginfo_t;
Figure 6-36 <sys/siginfo.h>
6-36
PowerPC Processor Supplement-September 1995
#define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define
ILL_ILLOPC ILL_ILLOPN ILL_ILLADR ILL_ILLTRP ILL_PRVOPC ILL_PRVREG ILL_COPROC ILL_BADSTK FPE_INTDIV FPE_INTOVF FPE_FLTDIV FPE_FLTOVF FPE_FLTUND FPE_FLTRES FPE_FLTINV FPE_FLTSUB SEGV_MAPERR SEGV_ACCERR BUS_ADRALN BUS_ADRERR BUS_OBJERR TRAP_BRKPT TRAP_TRACE CLD_EXITED CLD_KILLED CLD_DUMPED CLD_TRAPPED CLD_STOPPED CLD_CONTINUED POLL_IN POLL_OUT POLL_MSG POLL_ERR POLL_PRI POLL_HUP
illegal opcode illegal operand illegal addressing mode illegal trap privileged opcode privileged register co-processor stack integer divide zero integer overflow floating point divide zero floating point overflow floating point underflow floating point inexact result invalid floating point subscript range address mapped object invalid permissions invalid address alignment non-existent physical address object specific hardware error breakpoint trap trace trap child exited child killed child coredumped traced child stopped child stopped signal stopped child continued input available output possible message available error high priority input available device disconnected
#define PROF_SIG
have code nonzero
#define SI_MAXSZ #define SI_PAD ((SI_MAXSZ sizeof (int)) typedef struct siginfo si_signo; si_code; si_errno; union _pad[SI_PAD]; struct pid_t _pid; union struct uid_t _uid; union sigval _value; _kill; struct clock_t _utime; _status;
Libraries
6-35
#define SA_SIGINFO
0x00000008
#define SA_NOCLDWAIT 0x00010000 don't save zombie children #define SS_ONSTACK 0x00000001 #define SS_DISABLE 0x00000002 struct sigaltstack char *ss_sp; ss_size; ss_flags; typedef struct sigaltstack stack_t;
Figure 6-35 <signal.h>
6-34
PowerPC Processor Supplement-September 1995
#define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define
SIGHUP hangup SIGINT interrupt (rubout) SIGQUIT quit (ASCII SIGILL illegal instr. (not reset when caught) SIGTRAP trace trap (not reset when caught) SIGIOT instruction SIGABRT used abort SIGEMT instruction SIGFPE floating point exception SIGKILL kill (cannot caught ignored) SIGBUS error SIGSEGV segmentation violation SIGSYS argument system call SIGPIPE write pipe with read SIGALRM alarm clock SIGTERM software termination signal from kill SIGUSR1 user defined signal SIGUSR2 user defined signal SIGCLD child status change SIGCHLD child status change alias (POSIX) SIGPWR power-fail restart SIGWINCH window size change SIGURG urgent socket condition SIGPOLL pollable event occured SIGIO SIGPOLL socket possible (SIGPOLL alias) SIGSTOP stop (cannot caught ignored) SIGTSTP user stop requested from SIGCONT stopped process been continued SIGTTIN background read attempted SIGTTOU background write attempted SIGVTALRM virtual timer expired SIGPROF profiling timer expired SIGXCPU exceeded limit SIGXFSZ exceeded file size limit SIGWAITING process's lwps blocked SIG_DFL (void (*)())0 SIG_ERR (void (*)())-1 SIG_IGN (void (*)())1 SIG_HOLD (void (*)())2
typedef struct unsigned long sigset_t;
_sigbits[4];
struct sigaction sa_flags; void (*_handler)(); sigset_t sa_mask; sa_resv[2]; #define #define #define #define SA_NOCLDSTOP SA_ONSTACK SA_RESETHAND SA_RESTART 0x00020000 0x00000001 0x00000002 0x00000004
Libraries
6-33
#define SHM_RDONLY #define SHM_RND
010000 020000
struct shmid_ds struct ipc_perm shm_perm; operation permission struct shm_segsz; size segment bytes struct anon_map *shm_amp; segment anon_map pointer unsigned short shm_lkcnt; number times locked pid_t shm_lpid; last shmop pid_t shm_cpid; creator unsigned long shm_nattch; used only shminfo unsigned long shm_cnattch;/* used only shminfo time_t shm_atime; last shmat time long shm_pad1; resv'd time_t expansion time_t shm_dtime; last shmdt time long shm_pad2; resv'd time_t expansion time_t shm_ctime; last change time long shm_pad3; resv'd time_t expansion long shm_pad4[4];/* reserve area
Figure 6-34 <sys/shm.h>
6-32
PowerPC Processor Supplement-September 1995
#define SEM_UNDO #define #define #define #define #define #define #define GETNCNT GETPID GETVAL GETALL GETZCNT SETVAL SETALL
010000
adjust exit entry semncnt sempid semval semval's semzcnt semval semval's
struct semid_ds struct ipc_perm sem_perm; operation permission struct struct *sem_base; first semaphore unsigned short sem_nsems; semaphores time_t sem_otime; last semop time long sem_pad1; reserved time_t expansion time_t sem_ctime; last change time long sem_pad2; time_t expansion long sem_pad3[4]; reserve area struct unsigned short semval; pid_t sempid; unsigned short semncnt; unsigned short semzcnt; struct sembuf unsigned short short short
semaphore value last operation awaiting semval cval awaiting semval
sem_num; sem_op; sem_flg;
semaphore semaphore operation operation flags
Figure 6-32 <sys/sem.h>
#define _INT_JBLEN #define _DBL_JBLEN #define _SIGJBLEN
typedef struct int_vals[_INT_JBLEN]; double dbl_vals[_DBL_JBLEN]; pad[2]; jmp_buf[1]; typedef sigjmp_buf[_SIGJBLEN];
Figure 6-33 <setjmp.h>
Libraries
6-31
enum xdr_op XDR_ENCODE XDR_DECODE XDR_FREE struct xdr_discrim value; xdrproc_t proc; enum authdes_namekind ADN_FULLNAME, ADN_NICKNAME struct authdes_fullname char name; client name, MAXNETNAMELEN union des_block key; conversation unsigned long window; associated window struct authdes_cred enum authdes_namekind adc_namekind; struct authdes_fullname adc_fullname; unsigned long adc_nickname; typedef struct enum xdr_op x_op; operation; fast additional param struct xdr_ops bool_t (*x_getlong)(struct long bool_t (*x_putlong)(struct long bool_t (*x_getbytes)(struct caddr_t, int); bool_t (*x_putbytes)(struct caddr_t, int); u_int (*x_getpostn)(struct bool_t (*x_setpostn)(struct u_int); long (*x_inline)(struct int); void (*x_destroy)(struct bool_t (*x_control)(struct int, void *x_ops; char x_public; users' data char x_private; pointer private data char x_base; private used position info x_handy; extra private word XDR; typedef bool_t (*xdrproc_t)();
Figure 6-30 <rpc.h>
typedef struct entry char *key, *data; ENTRY; typedef enum FIND, ENTER ACTION; typedef enum preorder, postorder, endorder, leaf VISIT;
Figure 6-31 <search.h>
6-30
PowerPC Processor Supplement-September 1995
AR_versions; struct char where; xdrproc_t proc; AR_results; many other null cases struct rejected_reply enum reject_stat rj_stat; union struct unsigned long low; unsigned long high; RJ_versions; enum auth_stat RJ_why; auth. work struct reply_body enum reply_stat rp_stat; union struct accepted_reply RP_ar; struct rejected_reply RP_dr; struct call_body unsigned long cb_rpcvers; unsigned long cb_prog; unsigned long cb_vers; unsigned long cb_proc; struct opaque_auth cb_cred; struct opaque_auth cb_verf; struct rpc_msg unsigned long rm_xid; enum msg_type rm_direction; union struct call_body RM_cmb; struct reply_body RM_rmb; struct rpcb unsigned long unsigned long char char char
must equal
provided client
r_prog; r_vers; r_netid; r_addr; r_owner;
struct rpcblist struct rpcb rpcb_map; struct rpcblist *rpcb_next;
Libraries
6-29
typedef struct _svcxprt xp_fd; u_short xp_port; struct xp_ops *xp_ops; xp_addrlen; length remote addr. Obsoleted char *xp_tp transport provider device name char *xp_netid; network token struct netbuf xp_ltaddr; local transport address struct netbuf xp_rtaddr; remote transport address char xp_raddr[16]; remote address. obsoleted struct opaque_auth xp_verf; response verifier char xp_p1; private: char xp_p2; private: char xp_p3; private: SVCXPRT; struct svc_req u_long rq_prog; service program number u_long rq_vers; service protocol version u_long rq_proc; desired procedure struct opaque_auth rq_cred; creds from wire caddr_t rq_clntcred; read only cooked cred struct _svcxprt *rq_xprt; associated transport enum msg_type CALL REPLY enum reply_stat MSG_ACCEPTED MSG_DENIED enum accept_stat SUCCESS PROG_UNAVAIL PROG_MISMATCH PROC_UNAVAIL GARBAGE_ARGS SYSTEM_ERR enum reject_stat RPC_MISMATCH AUTH_ERROR struct accepted_reply struct opaque_auth ar_verf; enum accept_stat ar_stat; union struct unsigned long low; unsigned long high;
6-28
PowerPC Processor Supplement-September 1995
u_long high; highest version supported RE_vers; struct maybe meaningful RPC_FAILED long long RE_lb; life boot debugging only struct rpc_createerr enum clnt_stat cf_stat; struct rpc_err cf_error; useful when RPC_PMAPFAILURE typedef struct _client AUTH *cl_auth; authenticator struct clnt_ops enum clnt_stat (*cl_call)(struct _client u_long, xdrproc_t, caddr_t, xdrproc_t, caddr_t, struct timeval); void (*cl_abort)(); abort call void (*cl_geterr)(struct _client struct rpc_err bool_t (*cl_freeres)(struct _client xdrproc_t, caddr_t); void (*cl_destroy)(struct _client bool_t (*cl_control)(struct _client int, char (*cl_settimers)(struct _client struct rpc_timers struct rpc_timers int, void (*)(), caddr_t, u_long); *cl_ops; char cl_private; private stuff char *cl_netid; network token char *cl_tp; device name CLIENT; #define FEEDBACK_REXMIT1 #define FEEDBACK_OK #define #define #define #define #define #define #define CLSET_TIMEOUT CLGET_TIMEOUT CLGET_SERVER_ADDR CLGET_FD CLGET_SVC_ADDR CLSET_FD_CLOSE CLSET_FD_NCLOSE first retransmit retransmits timeout (timeval) timeout (timeval) server's (sockaddr) connections file descr server's addr (netbuf) close while clnt_destroy close while clnt_destroy retry timeout (timeval) retry timeout (timeval)
#define CLSET_RETRY_TIMEOUT #define CLGET_RETRY_TIMEOUT
extern struct rpc_createerr rpc_createerr; enum xprt_stat XPRT_DIED, XPRT_MOREREQS, XPRT_IDLE
Libraries
6-27
#define #define #define #define #define
AUTH_NULL AUTH_SYS AUTH_UNIX AUTH_SHORT AUTH_DES
backward compatibility unix style (uid, gids) AUTH_SYS short hand unix style style (encrypted timestamps)
enum clnt_stat RPC_SUCCESS call succeeded RPC_CANTENCODEARGS can't encode arguments RPC_CANTDECODERES can't decode results RPC_CANTSEND failure sending call RPC_CANTRECV failure receiving result RPC_TIMEDOUT call timed RPC_INTR call interrupted RPC_UDERROR recv uderr indication RPC_VERSMISMATCH versions compatible RPC_AUTHERROR authentication error RPC_PROGUNAVAIL program available RPC_PROGVERSMISMATCH program version mismatched RPC_PROCUNAVAIL procedure unavailable RPC_CANTDECODEARGS decode arguments error RPC_SYSTEMERROR generic "other problem" RPC_UNKNOWNHOST unknown host name RPC_UNKNOWNPROTO unknown protocol RPC_UNKNOWNADDR Remote address unknown RPC_NOBROADCAST Broadcasting supported RPC_RPCBFAILURE pmapper failed call RPC_PROGNOTREGISTERED 15,/* remote prog registered RPC_N2AXLATEFAILURE name address translation failed*/ RPC_TLIERROR misc error library RPC_FAILED unspecified error #define RPC_PMAPFAILURE RPC_RPCBFAILURE #define #define #define #define #define #define #define #define #define _RPC_NONE _RPC_NETPATH _RPC_VISIBLE _RPC_CIRCUIT_V _RPC_DATAGRAM_V _RPC_CIRCUIT_N _RPC_DATAGRAM_N _RPC_TCP _RPC_UDP RPC_ANYSOCK
#define RPC_ANYSOCK #define RPC_ANYFD
struct rpc_err enum clnt_stat re_status; union struct RE_errno; related system error RE_t_errno; related error number RE_err; enum auth_stat RE_why; auth error occurred struct u_long low; lowest version supported
6-26
PowerPC Processor Supplement-September 1995
#define MAX_AUTH_BYTES #define MAXNETNAMELEN #define HEXKEYBYTES
length user's name
enum auth_stat AUTH_OK AUTH_BADCRED bogus credentials (seal broken) AUTH_REJECTEDCRED client should begin session AUTH_BADVERF bogus verifier (seal broken) AUTH_REJECTEDVERF verifier expired replayed AUTH_TOOWEAK rejected security reasons AUTH_INVALIDRESP bogus response verifier AUTH_FAILED some unknown reason union des_block struct unsigned long high; unsigned long low; key; char c[8]; struct opaque_auth oa_flavor; char oa_base; unsigned oa_length;
flavor auth address more auth stuff exceed MAX_AUTH_BYTES
typedef struct struct opaque_auth ah_cred; struct opaque_auth ah_verf; union des_block ah_key; struct auth_ops void (*ah_nextverf)(struct _auth (*ah_marshal)(struct _auth (*ah_validate)(struct _auth struct opaque_auth (*ah_refresh)(struct _auth void (*ah_destroy)(struct _auth *ah_ops; char *ah_private; AUTH; struct authsys_parms u_long aup_time; char *aup_machname; uid_t aup_uid; gid_t aup_gid; u_int aup_len; gid_t *aup_gids; extern struct opaque_auth _null_auth; #define AUTH_NONE authentication
Libraries
6-25
struct passwd char char uid_t gid_t char char char char char
*pw_name; *pw_passwd; pw_uid; pw_gid; *pw_age; *pw_comment; *pw_gecos; *pw_dir; *pw_shell;
Figure 6-28 <pwd.h>
#define #define #define #define #define #define #define #define
RLIMIT_CPU RLIMIT_FSIZE RLIMIT_DATA RLIMIT_STACK RLIMIT_CORE RLIMIT_NOFILE RLIMIT_VMEM RLIMIT_AS
RLIMIT_VMEM
time milliseconds maximum file size data size stack size core file size file descriptors maximum mapped memory
typedef unsigned long rlim_t; struct rlimit rlim_t rlim_cur; rlim_t rlim_max;
current limit maximum value rlim_cur
Figure 6-29 <sys/resource.h>
6-24
PowerPC Processor Supplement-September 1995
#define P_INITPID #define P_INITUID #define P_INITPGID typedef long id_t;
typedef enum idtype P_PID, process identifier. P_PPID, parent process identifier. P_PGID, process group (job control group) identifier. P_SID, session identifier. P_CID, scheduling class identifier. P_UID, user identifier. P_GID, group identifier. P_ALL, processes. P_LWPID identifier. idtype_t; typedef enum idop POP_DIFF, POP_AND, POP_OR, POP_XOR idop_t;
difference. processes which left operand right operand set. disjunction. processes which both left right operand sets. conjunction. processes which either left right operand sets both). exclusive processes which either left right operand sets both.
typedef struct procset idop_t p_op;
operator connection between following operands each which simple processes.
idtype_t
id_t idtype_t
p_lidtype; type left operand simple set. p_lid; left operand. p_ridtype; type right operand simple set. p_rid; right operand.
id_t procset_t; #define P_MYID (-1)
Figure 6-27 <sys/procset.h>
Libraries
6-23
#define #define #define #define #define #define #define
CANBSIZ NGROUPS_UMIN MAXPATHLEN MAXSYMLINKS MAXNAMELEN NADDR PIPE_MAX
1024 5120
size typewriter line
Figure 6-25 <sys/param.h>
typedef struct pollfd short events; short revents; pollfd_t; #define #define #define #define #define #define #define #define POLLIN POLLPRI POLLOUT POLLRDNORM POLLWRNORM POLLRDBAND POLLWRBAND POLLNORM 0x0001 0x0002 0x0004 0x0040 POLLOUT 0x0080 0x0100 POLLRDNORM 0x0008 0x0010 0x0020
file desc poll events interest events that occurred
readable high priority info writable (won't block) normal data readable out-of-band data readable out-of-band data writable
#define POLLERR #define POLLHUP #define POLLNVAL
error condition been hung invalid pollfd entry
Figure 6-26 <poll.h>
6-22
PowerPC Processor Supplement-September 1995
struct nd_addrlist struct netbuf
n_cnt; *n_addrs;
number netbufs netbufs
struct nd_hostservlist struct nd_hostserv struct nd_hostserv char char #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define ND_BADARG ND_NOMEM ND_OK ND_NOHOST ND_NOSERV ND_NOSYM ND_OPEN ND_ACCESS ND_UKNWN ND_NOCTRL ND_FAILCTRL ND_SYSTEM ND_HOSTSERV ND_HOSTSERVLIST ND_ADDR ND_ADDRLIST
h_cnt; number nd_hostservs *h_hostservs; entries
*h_host; *h_serv;
host name service name
arguments passed virtual memory left Translation successful Hostname resolvable Service unknown Couldn't resolve symbol File couldn't opened File accessible Unknown object freed Unknown netdir_options option*/ failed netdir_options Other System error
ND_SET_BROADCAST ND_SET_RESERVEDPORT ND_CHECK_RESERVEDPORT ND_MERGEADDR "\\1" "\\2" "\\3"
t_optmgmt broadcast bind reserve address check address resv'd Merge universal address
#define HOST_SELF #define HOST_ANY #define HOST_BROADCAST
Figure 6-23 <netdir.h>
#define NL_SETD XPG3 Conformant Default number.*/ #define NL_CAT_LOCALE (-1) XPG4 requirement typedef nl_item; XPG3 Conformant nl_langinfo().
Figure 6-24 <nl_types.h>
Libraries
6-21
struct netconfig char *nc_netid; network identifier unsigned long nc_semantics; defined below unsigned long nc_flag; defined below char *nc_protofmly; protocol family name*/ char *nc_proto; protocol name char *nc_device; device name unsigned long nc_nlookups;/* ents nc_lookups char **nc_lookups; list lookup directories unsigned long nc_unused[8]; #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define NC_TPI_CLTS NC_TPI_COTS NC_TPI_COTS_ORD NC_TPI_RAW NC_NOFLAG NC_VISIBLE NC_BROADCAST NC_NOPROTOFMLY NC_LOOPBACK NC_INET NC_IMPLINK NC_PUP NC_CHAOS NC_NS NC_NBS NC_ECMA NC_DATAKIT NC_CCITT NC_SNA NC_DECNET NC_DLI NC_LAT NC_HYLINK NC_APPLETALK NC_NIT NC_IEEE802 NC_OSI NC_X25 NC_OSINET NC_GOSIP NC_NOPROTO NC_TCP NC_UDP NC_ICMP "loopback" "inet" "implink" "pup" "chaos" "ns" "nbs" "ecma" "datakit" "ccitt" "sna" "decnet" "dli" "lat" "hylink" "appletalk" "nit" "ieee802" "osi" "x25" "osinet" "gosip" "tcp" "udp" "icmp"
Figure 6-22 <netconfig.h>
6-20
PowerPC Processor Supplement-September 1995
struct msqid_ds struct ipc_perm msg_perm; operation perm struct struct *msg_first; first message struct *msg_last; last message unsigned long msg_cbytes; current bytes unsigned long msg_qnum; messages unsigned long msg_qbytes; bytes pid_t msg_lspid; last msgsnd pid_t msg_lrpid; last msgrcv time_t msg_stime; last msgsnd time long msg_pad1; resv'd time_t expansion time_t msg_rtime; last msgrcv time long msg_pad2; time_t expansion time_t msg_ctime; last change time long msg_pad3; time expansion long msg_pad4[4];/* reserve area #define MSG_NOERROR 010000 error message
Figure 6-21 <sys/msg.h>
Libraries
6-19
typedef union _h_val unsigned long _i[2]; double _h_val; extern const _h_val _huge_val;
Figure 6-18 <math.h>
#define #define #define #define
PROT_NONE PROT_READ PROT_WRITE PROT_EXEC
0x10
pages can't pages pages pages
accessed read written executed
#define MAP_SHARED #define MAP_PRIVATE #define MAP_FIXED #define MS_SYNC #define MS_ASYNC #define MS_INVALIDATE
share changes changes private user assigns address wait msync return immediately invalidate caches
Figure 6-19 <sys/mman.h>
#define #define #define #define
MS_RDONLY MS_DATA MS_NOSUID MS_REMOUNT
0x01 0x04 0x10 0x20
Read-only 6-argument mount Setuid programs disallowed Remount
Figure 6-20 <sys/mount.h>
6-18
PowerPC Processor Supplement-September 1995
#define #define #define #define #define #define
ERA_D_FMT ERA_D_T_FMT ERA_T_FMT ALT_DIGITS YESEXPR NOEXPR
date format string date time format time format string alternate symbols digits affirmative response expr. negative response expression
Figure 6-15 <langinfo.h>
#define #define #define #define #define #define #define #define #define #define
MB_LEN_MAX TMP_MAX NL_ARGMAX NL_LANGMAX NL_MSGMAX NL_NMAX NL_SETMAX NL_TEXTMAX NZERO FCHR_MAX
17576 value "digit" bytes LANG name 32767 message number bytes N-to-1 mapping chars number 2048 number default process priority 1048576 size file bytes
Figure 6-16 <limits.h>
struct
lconv char *decimal_point; char *thousands_sep; char *grouping; char *int_curr_symbol; char *currency_symbol; char *mon_decimal_point; char *mon_thousands_sep; char *mon_grouping; char *positive_sign; char *negative_sign; char int_frac_digits; char frac_digits; char p_cs_precedes; char p_sep_by_space; char n_cs_precedes; char n_sep_by_space; char p_sign_posn; char n_sign_posn;
#define #define #define #define #define #define #define LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES LC_ALL
Figure 6-17 <locale.h>
Libraries
6-17
#define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define
DAY_1 DAY_2 DAY_3 DAY_4 DAY_5 DAY_6 DAY_7 ABDAY_1 ABDAY_2 ABDAY_3 ABDAY_4 ABDAY_5 ABDAY_6 ABDAY_7 MON_1 MON_2 MON_3 MON_4 MON_5 MON_6 MON_7 MON_8 MON_9 MON_10 MON_11 MON_12 ABMON_1 ABMON_2 ABMON_3 ABMON_4 ABMON_5 ABMON_6 ABMON_7 ABMON_8 ABMON_9 ABMON_10 ABMON_11 ABMON_12 RADIXCHAR THOUSEP YESSTR NOSTR CRNCYSTR D_T_FMT D_FMT T_FMT AM_STR PM_STR
sunday monday tuesday wednesday thursday friday saturday
january february march april june july august september october november december
radix character separator thousand affirmative response queries negative response queries currency symbol string formatting date time date format time format string string codeset name time format string description segments
#define CODESET #define T_FMT_AMPM #define
6-16
PowerPC Processor Supplement-September 1995
struct
group char *gr_name; char *gr_passwd; gid_t gr_gid; char **gr_mem;
Figure 6-13
<grp.h>
struct ipc_perm uid_t gid_t uid_t gid_t mode_t unsigned long key_t long #define IPC_CREAT #define IPC_EXCL #define IPC_NOWAIT #define IPC_PRIVATE #define IPC_RMID #define IPC_SET #define IPC_STAT
uid; gid; cuid; cgid; mode; seq; key; pad[4];
owner's user owner's group creator's user creator's group access modes slot usage sequence number reserve area
0001000 0002000 0004000
create doesn't exist fail exists error request must wait private remove identifier options options
(key_t)0
Figure 6-14 <sys/ipc.h>
Libraries
6-15
#define MM_NULL #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define MM_HARD MM_SOFT MM_FIRM MM_RECOVER MM_NRECOV MM_APPL MM_UTIL MM_OPSYS MM_PRINT MM_CONSOLE MM_NOSEV MM_HALT MM_ERROR MM_WARNING MM_INFO MM_NULLLBL MM_NULLSEV MM_NULLMC MM_NULLTXT MM_NULLACT MM_NULLTAG MM_NOTOK MM_OK MM_NOMSG MM_NOCON
0x00000001L 0x00000002L 0x00000004L 0x00000100L 0x00000200L 0x00000008L 0x00000010L 0x00000020L 0x00000040L 0x00000080L ((char MM_NOSEV ((char ((char ((char 0x00 0x01 0x04
Figure 6-11 <fmtmsg.h>
#define #define #define #define #define #define
FTW_F FTW_D FTW_DNR FTW_NS FTW_SL FTW_DP
file directory directory without read permission unknown type, stat failed symbolic link directory
#define FTW_PHYS #define FTW_MOUNT #define FTW_CHDIR #define FTW_DEPTH
lstat instead stat cross mount point chdir each directory before /*reading call descendents before calling parent
struct
quit; base; level;
Figure 6-12 <ftw.h>
6-14
PowerPC Processor Supplement-September 1995
#define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define
O_RDONLY O_WRONLY O_RDWR O_APPEND O_SYNC O_NONBLOCK O_CREAT O_TRUNC O_EXCL O_NOCTTY F_DUPFD F_GETFD F_SETFD F_GETFL F_SETFL F_SETLK F_SETLKW F_GETLK
0x08 0x10 0x80 0x100 0x200 0x400 0x800
read only write only read write append (writes guaranteed end)*/ synchronized file update option non-blocking (POSIX) open with file create open with truncation exclusive open don't allocate controlling Duplicate fildes fildes flags fildes flags file flags file flags file lock file lock wait file lock
File segment locking data type Information passed system user. typedef struct flock short l_type; short l_whence; off_t l_start; off_t l_len; means until file long l_sysid; pid_t l_pid; long l_pad[4]; reserve area flock_t; File #define #define #define
segment locking types. F_RDLCK F_WRLCK F_UNLCK Read lock Write lock Remove lock(s)
POSIX constants #define O_ACCMODE #define FD_CLOEXEC Mask file access modes close exec flag
Figure <fcntl.h>
extern _flt_rounds;
Figure 6-10 <float.h>
Libraries
6-13
#define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define
EBADSLT invalid slot EDEADLOCK file locking deadlock error EBFONT font file ENOSTR Device stream ENODATA data (for delay ETIME timer expired ENOSR streams resources ENONET Machine network ENOPKG Package installed EREMOTE object remote ENOLINK link been severed EADV advertise error ESRMNT srmount error ECOMM Communication error send EPROTO Protocol error EMULTIHOP multihop attempted EBADMSG trying read unreadable message ENAMETOOLONG path name long EOVERFLOW value large data type ENOTUNIQ given log. name unique EBADFD f.d. invalid this operation EREMCHG Remote address changed ELIBACC Can't access needed shared lib.*/ ELIBBAD Accessing corrupted shared lib.*/ ELIBSCN .lib section a.out corrupted.*/ ELIBMAX Attempting link many libs ELIBEXEC Attempting exec shared library EILSEQ Illegal byte sequence ENOSYS Unsupported file system operation ELOOP Symbolic link loop ERESTART Restartable system call ESTRPIPE pipe/FIFO: sleep stream head ENOTEMPTY directory empty EUSERS many users (for UFS) ESTALE Stale file handle
Figure <errno.h>
6-12
PowerPC Processor Supplement-September 1995
extern errno; #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define EPERM super-user ENOENT such file directory ESRCH such process EINTR interrupted system call error ENXIO such device address E2BIG list long ENOEXEC Exec format error EBADF file number ECHILD children EAGAIN Resource temporarily unavailable ENOMEM enough core EACCES Permission denied EFAULT address ENOTBLK Block device required EBUSY Mount device busy EEXIST File exists EXDEV Cross-device link ENODEV such device ENOTDIR directory EISDIR directory EINVAL Invalid argument ENFILE File table overflow EMFILE many open files ENOTTY Inappropriate ioctl device ETXTBSY Text file busy EFBIG File large ENOSPC space left device ESPIPE Illegal seek EROFS Read only file system EMLINK many links EPIPE Broken pipe EDOM Math domain func ERANGE Math result representable ENOMSG message desired type EIDRM Identifier removed ECHRNG Channel number range EL2NSYNC Level synchronized EL3HLT Level halted EL3RST Level reset ELNRNG Link number range EUNATCH Protocol driver attached ENOCSI structure available EL2HLT Level halted EDEADLK Deadlock condition.*/ ENOLCK record locks available.*/ ECANCELED Operation canceled ENOTSUP Operation supported EBADE invalid exchange EBADR invalid request descriptor EXFULL exchange full ENOANO anode EBADRQC invalid request code
Libraries
6-11
System Data Interfaces
Data Definitions
This section contains standard header files that describe system data. These files referred names angle backets: <name.h> <sys/name.h>. Included these headers macro definitions data definitions. data objects described this section part interface between ABI-conforming application underlying ABI-conforming system which will run. While ABI-conforming system must provide these interfaces, system does have include actual header files referenced here. Programmers should observe that source structures defined these headers defined System Interface Definition. ANSI serves reference programming language, data definitions specified ANSI format. language used here convenient notation. Using language description these data objects does preclude their other programming languages.
#define #define #define #define #define #define #define #define
0100 0200
Upper case Lower case Numeral (digit) Spacing character Punctuation Control character Blank heXadecimal digit
extern unsigned char
_ctype[521];
Figure <ctype.h>
struct dirent ino_t d_ino; "inode number" entry off_t d_off; offset disk directory entry unsigned short d_reclen; length this record char d_name[1]; name file
Figure <dirent.h>
6-10
PowerPC Processor Supplement-September 1995
long long wstoll( const wchar_t wchar_t **b, This function converts base-c string pointed signed long long value returns this value. non-NULL, point first wide-character that interpreted part converted value.
Global Data Symbols
libsys library requires that some global external data objects defined routines work properly. addition corresponding data symbols listed System ABI, following symbol must provided system library ABI-conforming systems implemented with PowerPC Architecture. Declarations data objects listed below found Data Definitions section this chapter.
_huge_val Figure libsys Global External Data Symbols
Application Constraints
described above, libsys provides symbols applications. cases, however, application obliged provide symbols library. addition application-provided symbols listed this section System ABI, conforming applications PowerPC Architecture also required provide following symbols: extern _end; This symbol refers neither routine location with interesting contents. Instead, address must correspond beginning program's dynamic allocation area, called "heap." Typically, heap begins immediately after data segment program's executable file. extern const _lib_version; This variable's value specifies compilation execution mode program. value zero, program wants preserve semantics older (pre-ANSI) where conflicts exist with ANSI. Otherwise, value nonzero, program wants ANSI semantics.
Libraries
Optional Routines
Note that facilities interfaces described this section optional components PowerPC Processor Supplement. addition routines specified System ABI, libc also contain following routines: atoll strtoll llabs strtoull lldiv ulltostr lltostr wstoll
Figure libc Optional Routines following routines 64-bit counterparts 32-bit routines specified System ABI. beneficial implementations that provide 64-bit signed unsigned integer data types include these routines libc. descriptions below, non-standard names long long signed long long) unsigned long long used refer these types. routines employ standard calling sequence described Function Calling Sequence Chapter each long long argument return value treated same manner structure consisting solely longs. Descriptions written from caller's point view with respect register usage stack frame layout. long long atoll( const char This function converts decimal string pointed signed long long value returns this value. long long llabs( long long This function returns absolute value lldiv_t lldiv( long long long long This function divides returns structure (lldiv_t) containing long long quotient remainder. This structure same div_t structure described System Interface Definition, except that quot members type long long instead int. char *lltostr( long long char This function returns pointer string represented long long value long long strtoll( const char char **b, This function converts base-c string pointed signed long long value returns this value. non-NULL, point first character that interpreted part converted value. unsigned long long strtoull( const char char **b, This function converts base-c string pointed unsigned long long value returns this value. non-NULL, point first character that interpreted part converted value. char *ulltostr( unsigned long long char This function returns pointer string represented unsigned long long value
PowerPC Processor Supplement-September 1995
arg_ARGPOINTER struct, union, long double argument represented PowerPC calling conventions pointer copy object. arg_WORD 32-bit aligned word argument, simple integer types, pointer object type. arg_DOUBLEWORD long long argument. arg_ARGREAL double argument. Note that float arguments converted passed double arguments. mechanism locating tags, described Locating Tags Chapter involves following three functions: _add_module_tags(struct module_tags *mt) This function adds section described argument list active sections. _delete_module_tags(struct module_tags *mt) This function removes section described argument from list active sections. _tag_lookup_pc(caddr_t This function returns pointer module_tags structure that describes tags section applicable given value, NULL there applicable tags section.
Libraries
Library
Required Routines
implementation must provide following processor-specific support routines libc. _va_arg _tag_register _tag_deregister _tag_lookup
Figure libc Required Routines void _va_arg(va_list argp, _va_arg_type type) This function used va_arg macros <stdarg.h> <varargs.h>, returns pointer next argument specified variable argument list argp. variable argument list array structure, shown below.
void _va_arg(va_list argp, _va_arg_type type) overflow_arg_area initially address which first passed stack, any, stored. reg_save_area start where r3:r10 were stored. reg_save_area must doubleword aligned. f1:f8 have been stored (because reg_save_area+4*8 must start where f1:f8 were stored typedef struct char gpr;
index into array GPRs stored register save area gpr=0 corresponds gpr=1 etc. char fpr; index into array FPRs stored register save area fpr=0 corresponds fpr=1 etc. char *overflow_arg_area; location stack that holds next overflow argument char *reg_save_area; where r3:r10 f1:f8 saved) stored va_list[1];
argument assumed type type. types are:
PowerPC Processor Supplement-September 1995
long long _div64( long long long long This function computes quotient truncating fractional part, returns signed long long result. long long _dtoll( double This function converts double precision value signed long long truncating fractional part returns signed long long value. unsigned long long _dtoull( double This function converts double precision value unsigned long long truncating fractional part returns unsigned long long value. long long _rem64( long long long long This function computes remainder upon dividing returns signed long long result. unsigned long long _udiv64( unsigned long long unsigned long long This function computes quotient truncating fractional part, returns unsigned long long result. unsigned long long _urem64( unsigned long long unsigned long long This function computes remainder upon dividing returns unsigned long long result.
Libraries
Optional Support Routines
Note that facilities interfaces described this section optional components PowerPC Processor Supplement. addition processor-specific routines specified above, libsys also contain following processor-specific support routines. _q_lltoq _div64 _udiv64 _q_qtoll _dtoll _urem64 _q_qtoull _dtoull _q_ulltoq _rem64
Figure libsys Optional Support Routines following routines support software emulation arithmetic operations implementations that provide 64-bit signed unsigned integer data types. descriptions below, non-standard names long long signed long long) unsigned long long used refer these types. routines employ standard calling sequence described Function Calling Sequence Chapter Descriptions written from caller's point view with respect register usage stack frame layout. Note that functions prefixed below implement extended precision arithmetic operations. following restriction applies each these functions: floating-point exceptions occur, appropriate exception bits FPSCR updated; corresponding exception enabled, floating-point exception trap handler invoked.
Note references following descriptions where corresponding arguments pointers long double quantities, refer values pointed pointers themselves.
long double _q_lltoq( long long This function converts long long value extended precision returns extended precision value. long long _q_qtoll( const long double This function converts extended precision value signed long long truncating fractional part returns signed long long value. unsigned long long _q_qtoull( const long double This function converts extended precision value unsigned long long truncating fractional part returns unsigned long long value. long double _q_ulltoq( unsigned long long This function converts unsigned long long value extended precision returns extended precision value.
PowerPC Processor Supplement-September 1995
long double _q_neg( const long double This function returns without raising exceptions. double _q_qtod( const long double This function converts extended precision value double precision returns double precision value. _q_qtoi( const long double This function converts extended precision value signed integer truncating fractional part returns signed integer value. float _q_qtos( const long double This function converts extended precision value single precision returns single precision value. unsigned _q_qtou( const long double This function converts extended precision value unsigned integer truncating fractional part returns unsigned integer value. long double _q_sqrt( const long double This function returns square root computed quadruple precision. long double _q_stoq( float This function converts single precision value extended precision returns extended precision value. long double _q_sub( const long double const long double This function returns computed extended precision. long double _q_utoq( unsigned This function converts unsigned integer value extended precision returns extended precision value. unsigned _dtou( double This function converts double precision value unsigned integer truncating fractional part returns unsigned integer value. _dtou raises exceptions follows: 2^32, operation successful. whole number, exceptions raised. whole number, inexact exception raised.
Otherwise, value returned _dtou unspecified, invalid operation exception raised. exceptions occur, appropriate exception bits FPSCR updated and, corresponding exception enable bits bits register both zero, system floating-point exception trap handler invoked.
Libraries
Relation
Value
equal less than greater than unordered with respect
_q_cmpe( const long double const long double This function performs ordered comparison extended precision values returns integer value that indicates their relative ordering according same convention _q_cmp. long double _q_div( const long double const long double This function returns computed extended precision. long double _q_dtoq( double This function converts double precision value quadruple precision returns extended precision value. _q_feq( const long double const long double This function performs unordered comparison extended precision values returns nonzero value they equal, zero otherwise. _q_fge( const long double const long double This function performs ordered comparison extended precision values returns nonzero value greater than equal zero otherwise. _q_fgt( const long double const long double This function performs ordered comparison extended precision values returns nonzero value greater than zero otherwise. _q_fle( const long double const long double This function performs ordered comparison extended precision values returns nonzero value less than equal zero otherwise. _q_flt( const long double const long double This function performs ordered comparison extended precision values returns nonzero value less than zero otherwise. _q_fne( const long double const long double This function performs unordered comparison extended precision values returns nonzero value they unordered equal, zero otherwise. long double _q_itoq( This function converts integer value extended precision returns extended precision value. long double _q_mul( const long double const long double This function returns computed extended precision.
PowerPC Processor Supplement-September 1995
LIBRARIES
System Library
Support Routines
addition operating system services, libsys contains following processor-specific support routines. _q_add _q_dtoq _q_fle _q_mul _q_qtos _q_sub _q_cmp _q_feq _q_flt _q_neg _q_qtou _q_utoq _q_cmpe _q_fge _q_fne _q_qtod _q_sqrt _dtou _q_div _q_fgt _q_itoq _q_qtoi _q_stoq
Figure libsys Support Routines Routines listed below employ standard calling sequence described Function Calling Sequence Chapter Descriptions written from caller's point view with respect register usage stack frame layout. Note that functions prefixed below implement extended precision arithmetic operations. following restrictions apply each these functions: When function returns extended precision result, that result rounded accordance with setting rounding control (RN) field FPSCR register. floating-point exceptions occur, appropriate exception bits FPSCR updated; corresponding exception enabled, floating-point exception trap handler invoked.
Note references following descriptions where corresponding arguments pointers long double quantities, refer values pointed pointers themselves.
long double _q_add( const long double const long double This function returns computed extended precision. _q_cmp( const long double const long double This function performs unordered comparison extended precision values returns integer value that indicates their relative ordering, shown below.
Libraries
Following steps below, dynamic linker program cooperate resolve symbolic references through procedure linkage table. Again, steps described below explanation only. precise execution-time behavior dynamic linker specified. shown above, procedure linkage table entries initially transfer .PLTresolve, allowing dynamic linker gain control first execution each table entry. example, assume program calls name, which transfers control label .PLTi. procedure linkage table entry loads into four times index relocation entry .PLTi branches .PLTresolve, which then calls into dynamic linker with pointer symbol table object r12. dynamic linker finds relocation entry corresponding index r11. will have type R_PPC_JMP_SLOT, offset will specify address .PLTi, symbol table index will reference name. Knowing this, dynamic linker finds symbol's "real" value. then modifies code .PLTi ways. target symbol reachable from .PLTi branch instruction, overwrites "addi r11,r0,4*(i-1)" instruction .PLTi with branch target. other hand, target symbol reachable from .PLTi, dynamic linker loads target address into word .PLTtable+4*(i-1) overwrites .PLTresolve" with .PLTcall". Subsequent executions procedure linkage table entry will transfer control directly function, either directly using .PLTcall, without invoking dynamic linker. indexes greater than equal 2^13, only even indexes shall used four words shall allocated each entry. above scheme used, this allows four instructions loading index branching .PLTresolve .PLTcall, instead only two. LD_BIND_NOW environment variable change dynamic linking behavior. value non-null, dynamic linker resolves function call binding load time, before transferring control program. That dynamic linker processes relocation entries type R_PPC_JMP_SLOT during process initialization. Otherwise, dynamic linker evaluates procedure linkage table entries lazily, delaying symbol resolution relocation until first execution table entry. Note Lazy binding generally improves overall application performance because unused symbols incur dynamic linking overhead. Nevertheless, situations make lazy binding undesirable some applications: initial reference shared object function takes longer than subsequent calls because dynamic linker intercepts call resolve symbol, some applications cannot tolerate this unpredictability. error occurs dynamic linker cannot resolve symbol, dynamic linker will terminate program. Under lazy binding, this might occur arbitrary times. Once again, some applications cannot tolerate this unpredictability. turning lazy binding, dynamic linker forces failure occur during process initialization, before application receives control.
PowerPC Processor Supplement-September 1995
relocation type each entry shall R_PPC_JMP_SLOT, relocation offset shall specify address first byte associated procedure linkage table entry, symbol table index shall reference appropriate symbol. illustrate procedure linkage tables, Figure shows dynamic linker might initialize procedure linkage table when loading executable shared object. .PLT: .PLTresolve: addis r12,r0,dynamic_linker@ha addi r12,r12,dynamic_linker@l mtctr addis r12,r0,symtab_addr@ha addi r12,r12,symtab_addr@l bctr .PLTcall: addis r11,r11,.PLTtable@ha r11,.PLTtable@l(r11) mtctr bctr .PLT1: addi r11,r0,4*0 .PLTresolve .PLTi: addi r11,r0,4*(i-1) .PLTresolve .PLTN: addi r11,r0,4*(N-1) .PLTresolve .PLTtable: word table begins here> Figure Procedure Linkage Table Example
Program Loading Dynamic Linking
details.The dynamic linker treats such symbol table entries specially. dynamic linker searching symbol encounters symbol table entry that symbol executable file, normally follows these rules: st_shndx member symbol table entry SHN_UNDEF, dynamic linker found definition symbol uses st_value member symbol's address. st_shndx member SHN_UNDEF symbol type STT_FUNC st_value member zero, dynamic linker recognizes this entry special uses st_value member symbol's address. Otherwise, dynamic linker considers symbol undefined within executable file continues processing.
Some relocations associated with procedure linkage table entries. These entries used direct function calls rather than references function addresses. These relocations treated special described above because dynamic linker must redirect procedure linkage table entries point themselves.
Procedure Linkage Table
Much global offset table redirects position-independent address calculations absolute locations, procedure linkage table redirects position-independent function calls absolute locations. link editor cannot resolve execution transfers (such function calls) from executable shared object another. Consequently, link editor arranges have program transfer control entries procedure linkage table. dynamic linker determines destinations' absolute addresses modifies procedure linkage table's memory image accordingly. dynamic linker thus redirect entries without compromising positionindependence sharability program's text. Executable files shared object files have separate procedure linkage tables. PowerPC, procedure linkage table (the .plt section) initialized executable shared object file. Instead, link editor simply reserves space dynamic linker initializes manages according own, possibly implementationdependent needs, subject following constraints: first words bytes) procedure linkage table reserved dynamic linker. There shall branches from executable shared object into these first words. executable shared object requires procedure linkage table entries, link editor shall reserve words (12*N bytes) following reserved words. first these words procedure linkage table entries themselves. static linker directs calls bytes (i-1)*8), between inclusive. remaining words (4*N bytes) reserved dynamic linker.
mentioned before, relocation table associated with procedure linkage table. DT_JMPREL entry _DYNAMIC array gives location first relocation entry. relocation table's entries parallel procedure linkage table entries one-to-one correspondence. That relocation table entry applies procedure linkage table entry
PowerPC Processor Supplement-September 1995
When dynamic linker creates memory segments loadable object file, processes relocation entries, some which will type R_PPC_GLOB_DAT, referring global offset table. dynamic linker determines associated symbol values, calculates their absolute addresses, sets global offset table entries proper values. Although absolute addresses unknown when link editor builds object file, dynamic linker knows addresses memory segments thus calculate absolute addresses symbols contained therein. global offset table entry provides direct access absolute address symbol without compromising position-independence sharability. Because executable file shared objects have separate global offset tables, symbol appear several tables. dynamic linker processes global offset table relocations before giving control code process image, thus ensuring absolute addresses available during execution. dynamic linker choose different memory segment addresses same shared object different programs; even choose different library addresses different executions same program. Nonetheless, memory segments change addresses once process image established. long process exists, memory segments reside fixed virtual addresses. global offset table's format interpretation processor specific. PowerPC, symbol _GLOBAL_OFFSET_TABLE_ used access table. symbol reside middle .got section, allowing both positive negative "subscripts" into array addresses. Four words global offset table reserved: word _GLOBAL_OFFSET_TABLE_[-1] shall contain blrl instruction (see text relating Figure 3-33, "Prologue Epilogue Sample Code"). word _GLOBAL_OFFSET_TABLE_[0] link editor hold address dynamic structure, referenced with symbol _DYNAMIC. This allows program, such dynamic linker, find dynamic structure without having processed relocation entries. This especially important dynamic linker, because must initialize itself without relying other programs relocate memory image. word _GLOBAL_OFFSET_TABLE_[1] reserved future use. word _GLOBAL_OFFSET_TABLE_[2] reserved future use.
global offset table resides .got section.
Function Addresses
References address function from executable file shared objects associated with need resolve same value. References from within shared objects will normally resolved dynamic linker virtual address function itself. References from within executable file function defined shared object will normally resolved link editor address procedure linkage table entry that function within executable file. allow comparisons function addresses work expected, executable file references function defined shared object, link editor will place address procedure linkage table entry that function associated symbol table entry. Symbol Values Chapter
Program Loading Dynamic Linking
Table Shared Object Segment Example Source Text Data Base Address
File Process Process Process Process
0x000200 0x100200 0x200200 0x300200 0x400200
0x02a400 0x12a400 0x22a400 0x32a400 0x42a400 0x100000 0x200000 0x300000 0x400000
Program Interpreter
program shall specify program interpreter other than /usr/lib/ld.so.1.
Dynamic Linking
Dynamic Section
Dynamic section entries give information dynamic linker. Some this information processor-specific, including interpretation some entries dynamic structure. DT_PLTGOT DT_JMPREL This entry's d_ptr member gives address first byte procedure linkage table (.PLT Figure 5-3). explained System ABI, this entry associated with table relocation entries procedure linkage table. PowerPC, this entry mandatory both executable shared object files. Moreover, relocation table's entries must have oneto-one correspondence with procedure linkage table. table DT_JMPREL relocation entries wholly contained within DT_RELA referenced table. Procedure Linkage Table later this chapter more information.
Global Offset Table
Position-independent code cannot, general, contain absolute virtual addresses. Global offset tables hold absolute addresses private data, thus making addresses available without compromising position-independence sharability program's text. program references global offset table using position-independent addressing extracts absolute values, thus redirecting position-independent references absolute locations.
PowerPC Processor Supplement-September 1995
Virtual Address 0x02000000
Segment
Header padding 0x100 bytes Text segment 0x2be00 bytes
0x02000100
Text
0x0202bf00
Data padding 0x100 bytes
0x0203b000
Text padding 0xf00 bytes Data segment 0x4e00 bytes
0x0203bf00 Data
0x02040d00 0x02041d24
Uninitialized data 0x1024 bytes Page padding 0x2dc zero bytes
Figure Process Image Segments aspect segment loading differs between executable files shared objects. Executable file segments contain absolute code. process execute correctly, segments must reside virtual addresses assigned when building executable file, with system using p_vaddr values unchanged virtual addresses. other hand, shared object segments typically contain position-independent code. This allows segment's virtual address change from process another, without invalidating execution behavior. Though system chooses virtual addresses individual processes, maintains "relative positions" segments. Because position-independent code uses relative addressing between segments, difference between virtual addresses memory must match difference between virtual addresses file. Table shows possible shared object virtual address assignments several processes, illustrating constant relative positioning. table also illustrates base address computations.
Program Loading Dynamic Linking
Table Member Text
Program Header Segments Data
p_type p_offset p_vaddr p_paddr p_filesz p_memsz p_flags p_align
PT_LOAD 0x100 0x02000100 unspecified 0x2be00 0x2be00 PF_R+PF_X 0x10000
PT_LOAD 0x2bf00 0x0203bf00 unspecified 0x4e00 0x5e24 PF_R+PF_W 0x10000
Although file offsets virtual addresses congruent modulo Kbytes both text data, four file pages hold impure text data (depending page size file system block size). first text page contains header, program header table, other information. last text page hold copy beginning data. first data page have copy text. last data page contain file information relevant running process.
Logically, system enforces memory permissions each segment were complete separate; segment addresses adjusted ensure that each logical page address space single permissions. example Figure 5-1, file region holding text beginning data mapped twice; virtual address text different virtual address data. data segment requires special handling uninitialized data, which system defines begin with zero values. Thus last data page file includes information logical memory page, extraneous data must zero, rather than unknown contents executable file. "Impurities" other three pages logically part process image; whether system expunges them unspecified. memory image program Figure presented Figure 5-2, assuming 4096 (0x1000) byte pages.
PowerPC Processor Supplement-September 1995
PROGRAM LOADING DYNAMIC LINKING
Program Loading
system creates augments process image, logically copies file's segment virtual memory segment. When-and if-the system physically reads file depends program's execution behavior, system load, process does require physical page unless references logical page during execution, processes commonly leave many pages unreferenced. Therefore, delaying physical reads frequently obviates them, improving system performance. obtain this efficiency practice, executable shared object files must have segment images whose offsets virtual addresses congruent, modulo page size. Virtual addresses file offsets PowerPC processor family segments congruent modulo Kbytes (0x10000) larger powers Although 4096 bytes currently PowerPC page size, this allows files suitable paging even implementations appear with larger page sizes. value p_align member each program header shared object file must 0x10000. Figure example executable file assuming executable program linked with base address 0x02000000 Mbytes).
File Offset header Program header table Other information 0x100 Text segment 0x2be00 bytes 0x2bf00 Data segment 0x4e00 bytes 0x30d00 Other information
Virtual Address
0x02000100
0x0202beff 0x0203bf00
0x02040cff
Figure Executable File Example
Program Loading Dynamic Linking
4-20
PowerPC Processor Supplement-September 1995
Name R_PPC_COPY
Description link editor creates this relocation type dynamic linking. offset member refers location writable segment. symbol table index specifies symbol that should exist both current object file shared object. During execution, dynamic linker copies data associated with shared object's symbol location specified offset. This relocation type resembles R_PPC_ADDR32, except that sets global offset table entry address specified symbol. This special relocation type allows determine correspondence between symbols global offset table entries. link editor creates this relocation type dynamic linking. offset member gives location procedure linkage table entry. dynamic linker modifies procedure linkage table entry transfer control designated symbol's address (see Figure Chapter link editor creates this relocation type dynamic linking. offset member gives location within shared object that contains value representing relative address. dynamic linker computes corresponding virtual address adding virtual address which shared object loaded relative address. Relocation entries this type must specify symbol table index.
R_PPC_GLOB_DAT
R_PPC_JMP_SLOT
R_PPC_RELATIVE
R_PPC_LOCAL24PC This relocation type resembles R_PPC_REL24, except that uses value symbol within object, interposed value, calculation. symbol referenced this relocation normally _GLOBAL_OFFSET_TABLE_, which additionally instructs link editor build global offset table. R_PPC_UADDR* These relocation types same corresponding R_PPC_ADDR* types, except that datum relocated allowed unaligned.
Object Files
4-19
Table Name R_PPC_PLTREL32 R_PPC_PLT16_LO R_PPL_PLT16_HI R_PPC_PLT16_HA R_PPC_SDAREL16 R_PPC_SECTOFF R_PPC_SECTOFF_LO R_PPC_SECTOFF_HI R_PPC_SECTOFF_HA R_PPC_ADDR30
Relocation Types (Continued)
Value
Field word32 half16 half16 half16 half16* half16* half16 half16 half16 word30
Calculation #lo(L #hi(L #ha(L _SDA_BASE_ #lo(R #hi(R #ha(R
Relocation values Table less than greater than reserved. Values range 101-200 names beginning with "R_PPC_EMB_" have been assigned embedded system use. relocation types whose Field column entry contains asterisk subject failure value computed does allocated bits. relocation types which names include _BRTAKEN _BRNTAKEN specify whether branch prediction (bit should indicate that branch will taken taken, respectively. unconditional branch, branch prediction must Relocation types with special semantics described below. Name R_PPC_GOT16* Description These relocation types resemble corresponding R_PPC_ADDR16* types, except that they refer address symbol's global offset table entry additionally instruct link editor build global offset table. This relocation type refers address symbol's procedure linkage table entry additionally instructs link editor build procedure linkage table. There implicit assumption that procedure linkage table module will within Mbytes instruction that branches that R_PPC_PLTREL24 relocation type only needed relocating branches procedure linkage table entries.
R_PPC_PLTREL24
4-18
PowerPC Processor Supplement-September 1995
Table Name R_PPC_NONE R_PPC_ADDR32 R_PPC_ADDR24 R_PPC_ADDR16 R_PPC_ADDR16_LO R_PPC_ADDR16_HI R_PPC_ADDR16_HA R_PPC_ADDR14 R_PPC_ADDR14_BRTAKEN R_PPC_ADDR14_BRNTAKEN R_PPC_REL24 R_PPC_REL14 R_PPC_REL14_BRTAKEN R_PPC_REL14_BRNTAKEN R_PPC_GOT16 R_PPC_GOT16_LO R_PPC_GOT16_HI R_PPC_GOT16_HA R_PPC_PLTREL24 R_PPC_COPY R_PPC_GLOB_DAT R_PPC_JMP_SLOT R_PPC_RELATIVE R_PPC_LOCAL24PC R_PPC_UADDR32 R_PPC_UADDR16 R_PPC_REL32 R_PPC_PLT32
Relocation Types
Value
Field none word32 low24* half16* half16 half16 half16 low14* low14* low14* low24* low14* low14* low14* half16* half16 half16 half16 low24* none word32 none word32 low24* word32 half16* word32 word32
Calculation none #lo(S #hi(S #ha(S #lo(G #hi(G #ha(G none below below
Object Files
4-17
Represents place (section offset address) storage unit being relocated (computed using r_offset). Represents offset symbol within section which symbol defined (its section-relative address). Represents value symbol whose index resides relocation entry.
Relocation entries apply halfwords words. either case, r_offset value designates offset virtual address first byte affected storage unit. relocation type specifies which bits change calculate their values. PowerPC family uses only Elf32_Rela relocation entries with explicit addends. relocation entries, r_addend member serves relocation addend. cases, offset, addend, computed result byte order specified header. following general rules apply interpretation relocation types Table 4-8: denote 32-bit modulus addition subtraction, respectively. ">>" denotes arithmetic right-shifting (shifting with sign copying) value left operand number bits given right operand. relocation types which names contain "14" "16," upper bits value computed before shifting must same. relocation types whose names contain "24," upper bits value computed before shifting must same. relocation types whose names contain "14" "24," bits value computed before shifting must zero. #hi(value) #lo(value) denote most least significant bits, respectively, indicated value. That #lo(x) 0xFFFF) #hi(x) 0xFFFF). "high adjusted" value, (value), compensates #lo() being treated signed number: #ha(x) (((x 0x8000) 0xFFFF). Reference calculation value implicitly creates entry indicated symbol. _SDA_BASE_ symbol defined link editor whose value shared objects same _GLOBAL_OFFSET_TABLE_, executable programs address within small data area. Small Data Area above.
4-16
PowerPC Processor Supplement-September 1995
word32 word30
This specifies 32-bit field occupying bytes, alignment which bytes unless otherwise specified. This specifies 30-bit field contained within bits 0-29 word with 4-byte alignment. least significant bits word unchanged. This specifies 24-bit field contained within word with 4-byte alignment. most significant least significant bits word ignored unchanged (for example, "Branch" instruction). This specifies 14-bit field contained within word with 4-byte alignment, comprising conditional branch instruction. 14-bit relative displacement bits 16-29, possibly "branch prediction bit" (bit 10), altered; other bits remain unchanged. This specifies 16-bit field occupying bytes with 2-byte alignment (for example, immediate field "Add Immediate" instruction).
low24
low14
half16
Calculations Table assume actions transforming relocatable file into either executable shared object file. Conceptually, link editor merges more relocatable files form output. first determines combine locate input files, next updates symbol values, then performs relocations. Relocations applied executable shared object files similar accomplish same result. following notations used Table 4-8: Represents addend used compute value relocatable field. Represents base address which shared object been loaded into memory during execution. Generally, shared object file built with base virtual address, execution address will different. Program Header System more information about base address. Represents offset into global offset table which address relocation entry's symbol will reside during execution. Coding Examples Chapter Global Offset Table Chapter more information. Represents section offset address procedure linkage table entry symbol. procedure linkage table entry redirects function call proper destination. link editor builds initial procedure linkage table, dynamic linker modifies entries during execution. Procedure Linkage Table Chapter more information.
Object Files
4-15
Relocation
Relocation Types
Relocation entries describe alter instruction data relocation fields shown Figure (bit numbers appear lower corners; Little-Endian byte numbers appear upper right corners; Big-Endian numbers appear upper left corners).
word32
word30
low24
half16
low14
Figure Relocation Fields
4-14
PowerPC Processor Supplement-September 1995
Note, however, that size small data area limited, indicated above. Compilers that support small data area relative addressing determine whether eligible data item placed small data area based size. data items less than equal specified size (the default usually bytes) placed small data area. Initialized data items placed .sdata section, uninitialized data items .sbss section. default size results small data area that large addressed with 16-bit relative offsets, link editor fails build executable shared object, some code that makes file must recompiled with smaller value size criterion.
Object Files
4-13
Symbol Table
Symbol Values
executable file contains reference function defined associated shared objects, symbol table section file will contain entry that symbol. st_shndx member that symbol table entry contains SHN_UNDEF. This informs dynamic linker that symbol definition that function contained executable file itself. that symbol been allocated procedure linkage table entry executable file, st_value member that symbol table entry nonzero, value virtual address first instruction that procedure linkage table entry. Otherwise, st_value member contains zero. This procedure linkage table entry address used dynamic linker resolving references address function. Function Addresses Chapter details.
Small Data Area
small data area part data segment executable program. contains data items within .sdata .sbss sections, which addressed with 16-bit signed offsets from base small data area. both shared object executable files, small data area straddles boundary between initialized uninitialized data data segment file. usual order sections data segment, some which empty,
.data .got .sdata .sbss .plt .bss
Only data items with local (non-global) scope appear small data area shared object. shared object small data area follows global offset table, data small data area addressed relative pointer. However, this case, small data area limited size more than Kbytes, less global offset table large. executable files, Kbytes data items with local global scope placed into small data area. executable file, symbol _SDA_BASE_ (small data area base) defined link editor address relative which data .sdata .sbss sections addressed with 16-bit signed offsets there neither .sdata .sbss section, value shared object, _SDA_BASE_ defined have same value _GLOBAL_OFFSET_TABLE_. value _SDA_BASE_ executable normally loaded into process initialization time, thereafter remains unchanged. particular, shared objects shall change value r13. Compilers generate "short-form," one-instruction references data items that .sdata .sbss sections. executable files, such references relative r13; shared objects, they relative register that contains address global offset table. Placing more data items small data areas usually results smaller faster program execution.
4-12
PowerPC Processor Supplement-September 1995
Similarly, module (conventionally, crtn.o), whose contents reflect pseudo-code Figure 4-3, appended after object modules containing executable instructions tags.
.section _tag_end: .section .long .long _tag_end _module_tags_end: .module_tags lastpc lasttag .tags
.section .fini Call
Figure crtn.o Pseudo-code When link editor builds executable shared object, concatenates contributions each section from various objects, order. Therefore, assuming that only crti.o crtn.o contribute .module_tags section, link editor places words .module_tags section crtn.o module immediately after four words that section crti.o module, forming complete, six-word module_tags structure. code .init section, which makes part initialization function specified dynamic section, adds section described module_tags list active sections. code .fini section deletes module_tags from active list using addressing relative structure avoid need globally visible, unique, symbol.
Object Files
4-11
mechanism locating tags involves three functions library (See Required Routines Chapter _add_module_tags(struct module_tags *mt) Adds module_tags object list module tags process. _delete_module_tags(struct module_tags *mt) Removes module_tags object from list. _tag_lookup_pc(caddr_t Returns pointer module_tags structure that describes tags section applicable given value, NULL there applicable tags section. _add_module_tags function generally called from initialization function specified dynamic structure; _delete_module_tags function generally called from termination function. (See Initialization Termination Functions System Application Binary Interface.) remainder this section describes arrange module construct module_tags structure list active sections. constructing executable shared object, module (conventionally, crti.o), whose contents reflect pseudo-code Figure below, inserted before object modules containing executable instructions tags.
.section _tag_start: .section .module_tags _module_tags_start: .long next pointer .long prev pointer .long firstpc .long _tag_start firsttag .section.init Call .tags
Figure crti.o Pseudo-code
4-10
PowerPC Processor Supplement-September 1995
[REGISTERS VALID TAG] Obtain which define register save areas, from closest Frame Frame Valid with BASE less than equal that Registers Valid tag. Replace recorded values floating-point (resp., general) registers corresponding FLOAT_REGS (resp., GEN_REGS) with values register save areas frame addressed Replace recorded values according C_REG LR_INREG step then continue with step [SNAPSHOT]. [SNAPSHOT] recorded values those entry current function, which called from address caller's frame pointed value recorded Replace with this value continue with step [POP FRAME] recorded nonzero, continue with step [LOOP]. Otherwise, this call chain. Terminate.
Locating Tags
Each object (executable file shared object) process image contains tags that apply executable instructions. preceding section assumed that possible program find tag, any, associated with particular address. This section describes mechanism that program uses locate tags. tags process described doubly linked list module_tags structures shown Figure below. There usually such structure each module process.
struct module_tags struct module_tags *next; struct module_tags *prev; caddr_t firstpc; caddr_t firsttag; caddr_t lastpc; caddr_t lasttag;
Next entry list*/ Previous entry list First which applicable Beginning tags Last which applicable First address beyond tags
Figure module_tags Structure firstpc lastpc values zero when _add_module_tags called. this case, _tag_lookup_pc compute values finding range implied tags addressed firsttag lasttag.
Object Files
Table
Word Bits Name
Special Format Description
0-29
BASE_OFFSET
(signed) number words between BASE which refers, positive lower address than BASE. (volatile) register that contains value link register function entry. (unsigned) number words between first last word which applies (zero applies only word).
30-31 TYPE 4-19 LR_SAVEREG RESERVED
20-29 RANGE
30-31 RESERVED
Stack Traceback Using Tags
following algorithm reconstructs values nonvolatile registers entry functions call chain. assumes image stack, values registers, address next instruction executed (PC). algorithm creates snapshot register values each function entry, beginning with latest working backward through successive call sites. [INITIALIZE] Record values nonvolatile general floating-point registers, TAG] there associated with then recorded values those entry function. value recorded step [SNAPSHOT]. [SPECIAL TAG] associated with Special tag, then recorded values those entry function, address caller, entry, LR_SAVEREG specified tag. this value step [SNAPSHOT}. [LOOP] associated with Frame Valid tag, continue with step Frame Tag, continue with step Registers Valid tag, continue with step [FRAME VALID TAG] lies beyond BASE tag, then replace recorded values (resp., highest numbered floating-point (resp., general) registers with values register save areas frame addressed C_REG replace recorded value. LR_INREG replace recorded value with saved value frame pointed step [SNAPSHOT]. [FRAME TAG] Same step with replaced with replaced with
PowerPC Processor Supplement-September 1995
Table
Word Bits Name
Registers Valid Format Description
0-17
FLOAT_REGS
each nonvolatile floating-point register, f31, f14, with signifying that register saved register save area.
18-29 START_OFFSET number words between BASE nearest preceding Frame Frame Valid first instruction which this applies. 30-31 TYPE 0-17 GEN_REGS
each nonvolatile general register, r31, r14, with signifying that register saved register save area. number words between first last instruction which this applies. only condition register saved assigned place register save area.
18-29 RANGE C_REG RESERVED
only Special defined this version tags applies leaf functions which, though they need establish frame, must modify value link register. example, leaf function shared object that needs frame requires pointer global offset table following sequence instructions access static data global offset table.
func:
mflr mflr mtlr
_GLOBAL_OFFSET_TABLE_-4
#Save #GOT pointer link register #GOT pointer #Use #Restore #Return
tbase:
tend:
above code would have Special specifying LR_SAVEREG with BASE referencing word tbase (the first instruction which does contain value entry) RANGE ((tend tbase)/4)
Object Files
Table
Word Bits Name
Frame Format (Continued) Description
16-29 RANGE
(unsigned) number words between BASE+4*FRAME_START last word which applies. ceases apply instruction after that deallocates frame, earlier register save state changes such that requires another tag. RANGE implies only establishing frame sizes save areas; subsequent Registers Valid tags supply register save data. only condition register saved assigned place register save area. link register holds contents entry function saved save word previous frame.
Frame Valid Format Description
C_REG LR_INREG
Table
Word Bits Name
6-29
FRAME_START BASE_OFFSET
Same Frame tag, except that specify number registers saved. Same Frame tag. number nonvolatile floating-point registers saved floating-point registers save area within RANGE tag. given floating-point register saved, must others with higher numbers. Same Frame tag. number nonvolatile general registers saved general registers save area within RANGE tag. given register saved, must others with higher numbers. Same Frame tag. Same Frame tag. Same Frame tag. Same Frame tag.
30-31 TYPE
10-14
15-19 20-29 RANGE C_REG LR_INREG
PowerPC Processor Supplement-September 1995
Formats
Every consists words bytes). low-order bits first word each specify type, encoded shown Table 4-3. Table
Formats Type
Code
Frame Frame Valid Registers Valid Special
Tables 4-5, 4-5, 4-6, specify formats each type. Frame, Frame Valid, Special tags, BASE refers address within code relative which offset fields within computed which tags sorted. BASE usually refers first instruction following instruction that establishes frame. Frame tags, RANGE implies only establishing frame sizes save areas; subsequent Registers Valid tags supply register save data. Table
Word Bits Name Frame Format Description
0-29
BASE_OFFSET
(signed) number words between BASE which refers, positive lower address than BASE. (unsigned, possibly zero) number words between BASE first address which registers implied values have been saved. interval between that address BASE, frame been established, save word previous frame contains address from which function called, nonvolatile registers still contain their values when function entered. Size double words floating-point register save area. Size words general register save area.
30-31 TYPE FRAME_START
6-10
11-15
Object Files
Tags
Overview
Tags facilitate determining contents nonvolatile registers they were when function entered. Given address next instruction executed, tag, any, applicable that address, debugger exception handler determine register contents upon function entry. stack frame layout, particular register save areas within frame, specified Chapter Tags make possible determine which stack frame associated with section code which nonvolatile registers time entry function within register save areas rather than registers themselves. simplest case, leaf function needs does establish frame does disturb contents nonvolatile registers link register. Similarly, within function, code that leaf-like that established frame restored stack, nonvolatile registers, link register their state entry function) needs tag. There four formats defined Table described subsequent tables. function that establishes frame requires least "Frame" "Frame Valid" tag. Both these formats specify point code which frame established sizes general floating-point register save areas. They also specify point which contiguous general floating-point registers have been saved save area range addresses from that point within which frame saved registers remain valid. function requires only Frame Frame Valid establishes frame, saves nonvolatile registers that uses before changing them, then restores registers deallocates frame. differences between Frame Frame Valid tags are: Frame support much larger modules. Frame Gbytes away from text which refers, while Frame Valid must within Mbytes text. Frame cover range 16,384 instructions, while Frame Valid cover only 1024 instructions. Functions with frames that span more instructions require multiple Frame Frame Valid tags. Frame requires that registers which space been allocated save areas saved. Frame Valid specify only save area sizes subset registers that stored save area within region covered tag.
Functions that intersperse saving some nonvolatile registers with using other nonvolatile registers, which save higher-numbered nonvolatile general floating-point registers before saving lower-numbered registers, need "Registers Valid" tags addition more Frame Frame Valid tags. Registers Valid specifies range addresses which valid each nonvolatile general floating-point register indicating whether been saved register save area contain value entry. Finally, there "Special" functions that establish frame link register.
PowerPC Processor Supplement-September 1995
Special sections described below.
Name Description
.got .plt .sdata .sbss
This section holds Global Offset Table, GOT. Coding Examples Chapter Global Offset Table Chapter more information. This section holds procedure linkage table. Procedure Linkage Table Chapter more information. This section holds initialized small data that contribute program memory image. Small Data Area later this chapter details. This section holds uninitialized small data that contribute program memory image. system sets data zeros when program begins run. Small Data Area details. This section contains tags described Tags below. size (sh_entsize) each entry this section alignment (sh_addralign) relocation section .rela.tags, associated with .tags section, should have SHF_EXCLUDE attribute. This section contains data that enable program locate tags. Locating tags described Tags below. This section, which appears object files only (not executable shared objects), contains entry each entry .tags section. Each entry STB_LOCAL binding type STT_NOTYPE. st_shndx st_value fields entries specify index section section offset which applies, respectively.
.tags
.taglist .tagsym
Note PowerPC Embedded shares most linkage conventions file structuring conventions this ABI. However, section names beginning with string ".PPC.EMB.", section names .sdata2 .sbss2, symbol _SDA2_BASE reserved Embedded ABI.
Object Files
Sections
Special Sections
Various sections hold program control information. sections listed Table used system have types attributes shown.
Note .plt section PowerPC type SHT_NOBITS, SHT_PROGBITS most other processors. Note SHT_ORDERED section type specifies that link editor sort entries this section based symbol addend values specified associated relocation entries. Entries without associated relocation entries shall appended section unspecified order. SHT_ORDERED defined SHT_HIPROC, first value reserved System processor-specific semantics. Note -The SHF_EXCLUDE flag specifies that link editor exclude this section from executable shared objects that builds when those objects further relocated. SHF_EXCLUDE value 0x80000000.
Table
Name Type
Special Sections Attributes
.got .plt .sdata .sbss .tags .taglist .tagsym
SHT_PROGBITS SHT_NOBITS SHT_PROGBITS SHT_NOBITS SHT_ORDERED SHT_PROGBITS SHT_SYMTAB
SHF_ALLOC SHF_WRITE SHF_ALLOC SHF_WRITE SHF_EXECINSTR SHF_ALLOC SHF_WRITE SHF_ALLOC SHF_WRITE SHF_ALLOC SHF_ALLOC SHF_WRITE SHF_EXCLUDE
PowerPC Processor Supplement-September 1995
OBJECT FILES
Header
Machine Information
file identification e_ident, PowerPC processor family requires values shown Table 4-1. Table
Position Value PowerPC Identification, e_ident Comments
e_ident[EI_CLASS] ELFCLASS32 e_ident[EI_DATA] e_ident[EI_DATA] ELFDATA2MSB ELFDATA2LSB
32-bit implementations Big-Endian implementations Little-Endian implementations
header's e_flags member holds flags associated with file. Since PowerPC processor family defines flags, this member contains zero. name EF_PPC_EMB value 0x80000000 reserved embedded systems. Processor identification resides header's e_machine member must have value defined name EM_PPC.
Object Files
Table PowerPC Privileged Register Number Mapping (Continued)
Register Name Number Abbreviation
Data Register Upper Data Register Lower Hardware Implementation Register Hardware Implementation Register Hardware Implementation Register Hardware Implementation Register Hardware Implementation Register
1108 1109 1110 1113 1123
DBAT3U SPR542 DBAT3L SPR543 HID0 SPR1008 HID1 SPR1009 HID2 IABR SPR1010 HID5 DABR SPR1013 HID15 SPR1023
Address Class Codes
PowerPC processor family defines address class codes described Table 3-9. Table Address Class Code
Code Value Meaning
ADDR_none
class specified
3-48
PowerPC Processor Supplement-September 1995
Table PowerPC Privileged Register Number Mapping
Register Name Number Abbreviation
Machine State Register Segment Register 0-15 Data Storage Interrupt Status Register Data Address Register Decrementer Storage Description Register Machine Status Save/Restore Register Machine Status Save/Restore Register Software-use Special Purpose Register Software-use Special Purpose Register Software-use Special Purpose Register Software-use Special Purpose Register Address Space Register External Access Register Time Base Time Base Upper Processor Version Register Instruction Register Upper Instruction Register Lower Instruction Register Upper Instruction Register Lower Instruction Register Upper Instruction Register Lower Instruction Register Upper Instruction Register Lower Data Register Upper Data Register Lower Data Register Upper Data Register Lower Data Register Upper Data Register Lower
70-85
SR0-SR15 DSISR SPR18 SPR19 SPR22 SDR1 SPR25 SRR0 SPR26 SRR1 SPR27 SPRG0 SPR272 SPRG1 SPR273 SPRG2 SPR274 SPRG3 SPR275 SPR280 SPR282 SPR284 SPR285 SPR287 IBAT0U SPR528 IBAT0L SPR529 IBAT1U SPR530 IBAT1L SPR531 IBAT2U SPR532 IBAT2L SPR533 IBAT3U SPR534 IBAT3L SPR535 DBAT0U SPR536 DBAT0L SPR537 DBAT1U SPR538 DBAT1L SPR539 DBAT2U SPR540 DBAT2L SPR541
Low-Level System Information
3-47
DWARF Definition
DWARF Release Number
This section defines Debug With Arbitrary Record Format (DWARF) debugging format PowerPC processor family. PowerPC does define debug format. However, systems that implement DWARF shall following definitions. DWARF specification developed symbolic, source-level debugging. debugging information format does favor design compiler debugger. more information DWARF, documents cited section Evolution Specification Chapter DWARF definition requires some machine-specific definitions. register number mapping needs specified PowerPC registers. addition, DWARF Version specification requires processor-specific address class codes defined.
DWARF Register Number Mapping
Table outlines register number mapping PowerPC processor family. kernel debuggers, mapping privileged registers also defined Table 3-8. Note that special purpose registers, number simply plus register number, defined PowerPC Architecture. Registers with asterisk before their name MPC601 chip-specific part generic PowerPC chip architecture. Table PowerPC Register Number Mapping
Register Name Number Abbreviation
General Register 0-31 Floating Register 0-31 Condition Register Floating-Point Status Control Register Register Fixed-Point Exception Register Real Time Clock Upper Register Real Time Clock Lower Register Link Register Count Register
0-31 32-63
R0-R31 F0-F31 FPSCR SPR0 SPR1 RTCU SPR4 RTCL SPR5 SPR8 SPR9
3-46
PowerPC Processor Supplement-September 1995
above process repeated many times desired within single function activation. When time return, stack pointer value back chain, thereby removing dynamically allocated stack space along with rest stack frame. Naturally, program must reference dynamically allocated stack area after been freed. Even presence signals, above dynamic allocation scheme "safe." signal interrupts allocation, three things happen: signal handler return. process then resumes dynamic allocation from point interruption. signal handler execute non-local goto jump. This resets process context previous stack frame, automatically discarding dynamic allocation. process terminate.
Regardless when signal arrives during dynamic allocation, result consistent (though possibly dead) process.
Low-Level System Information
3-45
parameter list area holds "overflow" arguments passed calls other functions. (See OTHER label algorithm Parameter Passing earlier this chapter.) size also known compiler allocated along with fixed frame area function entry. However, standard calling sequence requires that parameter list area begin fixed offset from stack pointer, this area must move when dynamic stack allocation occurs. Data parameter list area naturally addressed constant offsets from stack pointer. However, presence dynamic stack allocation, offsets from stack pointer data local variables area constant. provide addressability, frame pointer established locate local variables area consistently throughout function's activation. Dynamic stack allocation accomplished "opening" stack just above parameter list area. following steps show process detail: Sometime after stack frame acquired before first dynamic space allocation, register, frame pointer, value stack pointer. frame pointer used references function's local, non-static variables. amount dynamic space allocated rounded multiple bytes, that 16-byte stack alignment maintained. stack pointer decreased rounded byte count, address previous stack frame (the back chain) stored word addressed stack pointer. This shall accomplished atomically using stwu rS,-length(r1) length less than 32768 bytes, using stwux rS,r1,rspace, where contents back chain word rspace contains (negative) rounded number bytes allocated.
Before Dynamic Stack Allocation
After Dynamic Stack Allocation
Back chain Register save areas Area containing local, non-static variables Area constructing parameter lists callees save word Back chain
Back chain
Register save areas Area containing local, non-static variables
Dynamic Allocation Area
Area constructing parameter lists callees save word
Back chain
Figure 3-45 Dynamic Stack Space Allocation
3-44
PowerPC Process

Other recent searches


Xilinx - Xilinx   Xilinx Datasheet
XAPP1041 - XAPP1041   XAPP1041 Datasheet
Reference - Reference   Reference Datasheet
System - System   System Datasheet
Tri-Mode - Tri-Mode   Tri-Mode Datasheet
Ethernet - Ethernet   Ethernet Datasheet
Embedded - Embedded   Embedded Datasheet
Systems - Systems   Systems Datasheet
MicroBlaze - MicroBlaze   MicroBlaze Datasheet
PowerPC405 - PowerPC405   PowerPC405 Datasheet
Application - Application   Application Datasheet
Note - Note   Note Datasheet
TGC4406-SM - TGC4406-SM   TGC4406-SM Datasheet
MX28F640C3T - MX28F640C3T   MX28F640C3T Datasheet
M58PR512LE - M58PR512LE   M58PR512LE Datasheet
M58PR001LE - M58PR001LE   M58PR001LE Datasheet
IMX35 - IMX35   IMX35 Datasheet
HL6316G - HL6316G   HL6316G Datasheet

 

Privacy Policy | Disclaimer
© 2012 Datasheet Archive