libunwind-ia64.man 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  1. '\" t
  2. .\" Manual page created with latex2man on Thu Aug 16 09:44:44 MDT 2007
  3. .\" NOTE: This file is generated, DO NOT EDIT.
  4. .de Vb
  5. .ft CW
  6. .nf
  7. ..
  8. .de Ve
  9. .ft R
  10. .fi
  11. ..
  12. .TH "LIBUNWIND\-IA64" "3" "16 August 2007" "Programming Library " "Programming Library "
  13. .SH NAME
  14. libunwind\-ia64
  15. \-\- IA\-64\-specific support in libunwind
  16. .PP
  17. .SH INTRODUCTION
  18. .PP
  19. The IA\-64 version of libunwind
  20. uses a platform\-string of
  21. ia64
  22. and, at least in theory, should be able to support all
  23. operating systems adhering to the processor\-specific ABI defined for
  24. the Itanium Processor Family. This includes both little\-endian Linux
  25. and big\-endian HP\-UX. Furthermore, to make it possible for a single
  26. library to unwind both 32\- and 64\-bit targets, the type
  27. unw_word_t
  28. is always defined to be 64 bits wide (independent
  29. of the natural word\-size of the host). Having said that, the current
  30. implementation has been tested only with IA\-64 Linux.
  31. .PP
  32. When targeting IA\-64, the libunwind
  33. header file defines the
  34. macro UNW_TARGET_IA64
  35. as 1 and the macro UNW_TARGET
  36. as ``ia64\&'' (without the quotation marks). The former makes it
  37. possible for platform\-dependent unwind code to use
  38. conditional\-compilation to select an appropriate implementation. The
  39. latter is useful for stringification purposes and to construct
  40. target\-platform\-specific symbols.
  41. .PP
  42. One special feature of IA\-64 is the use of NaT bits to support
  43. speculative execution. Often, NaT bits are thought of as the ``65\-th
  44. bit\&'' of a general register. However, to make everything fit into
  45. 64\-bit wide unw_word_t
  46. values, libunwind
  47. treats the
  48. NaT\-bits like separate boolean registers, whose 64\-bit value is either
  49. TRUE (non\-zero) or FALSE (zero).
  50. .PP
  51. .SH MACHINE\-STATE
  52. .PP
  53. The machine\-state (set of registers) that is accessible through
  54. libunwind
  55. depends on the type of stack frame that a cursor
  56. points to. For normal frames, all ``preserved\&'' (callee\-saved)
  57. registers are accessible. For signal\-trampoline frames, all registers
  58. (including ``scratch\&'' (caller\-saved) registers) are accessible. Most
  59. applications do not have to worry a\-priori about which registers are
  60. accessible when. In case of doubt, it is always safe to \fItry\fP
  61. to
  62. access a register (via unw_get_reg()
  63. or
  64. unw_get_fpreg())
  65. and if the register isn\&'t accessible, the
  66. call will fail with a return\-value of \-UNW_EBADREG\&.
  67. .PP
  68. As a special exception to the above general rule, scratch registers
  69. r15\-r18
  70. are always accessible, even in normal
  71. frames. This makes it possible to pass arguments, e.g., to exception
  72. handlers.
  73. .PP
  74. For a detailed description of the IA\-64 register usage convention,
  75. please see the ``Itanium Software Conventions and Runtime Architecture
  76. Guide\&'', available at:
  77. .ce 100
  78. \fBhttp://www.intel.com/design/itanium/downloads/245358.htm\fP
  79. .ce 0
  80. .PP
  81. .SH REGISTER NAMES
  82. .PP
  83. The IA\-64\-version of libunwind
  84. defines three kinds of register
  85. name macros: frame\-register macros, normal register macros, and
  86. convenience macros. Below, we describe each kind in turn:
  87. .PP
  88. .SS FRAME\-REGISTER MACROS
  89. .PP
  90. Frame\-registers are special (pseudo) registers because they always
  91. have a valid value, even though sometimes they do not get saved
  92. explicitly (e.g., if a memory stack frame is 16 bytes in size, the
  93. previous stack\-pointer value can be calculated simply as
  94. sp+16,
  95. so there is no need to save the stack\-pointer
  96. explicitly). Moreover, the set of frame register values uniquely
  97. identifies a stack frame. The IA\-64 architecture defines two stacks
  98. (a memory and a register stack). Including the instruction\-pointer
  99. (IP), this means there are three frame registers:
  100. .TP
  101. UNW_IA64_IP:
  102. Contains the instruction pointer (IP, or
  103. ``program counter\&'') of the current stack frame. Given this value,
  104. the remaining machine\-state corresponds to the register\-values that
  105. were present in the CPU when it was just about to execute the
  106. instruction pointed to by UNW_IA64_IP\&.
  107. Bits 0 and 1 of
  108. this frame\-register encode the slot number of the instruction.
  109. \fBNote:\fP
  110. Due to the way the call instruction works on IA\-64,
  111. the slot number is usually zero, but can be non\-zero, e.g., in the
  112. stack\-frame of a signal\-handler trampoline.
  113. .TP
  114. UNW_IA64_SP:
  115. Contains the (memory) stack\-pointer
  116. value (SP).
  117. .TP
  118. UNW_IA64_BSP:
  119. Contains the register backing\-store
  120. pointer (BSP). \fBNote:\fP
  121. the value in this register is equal
  122. to the contents of register ar.bsp
  123. at the time the
  124. instruction at UNW_IA64_IP
  125. was about to begin execution.
  126. .PP
  127. .SS NORMAL REGISTER MACROS
  128. .PP
  129. The following normal register name macros are available:
  130. .TP
  131. UNW_IA64_GR:
  132. The base\-index for general (integer)
  133. registers. Add an index in the range from 0..127 to get a
  134. particular general register. For example, to access r4,
  135. the index UNW_IA64_GR+4
  136. should be used.
  137. Registers r0
  138. and r1
  139. (gp)
  140. are read\-only,
  141. and any attempt to write them will result in an error
  142. (\-UNW_EREADONLYREG).
  143. Even though r1
  144. is
  145. read\-only, libunwind
  146. will automatically adjust its value if
  147. the instruction\-pointer (UNW_IA64_IP)
  148. is modified. For
  149. example, if UNW_IA64_IP
  150. is set to a value inside a
  151. function func(),
  152. then reading
  153. UNW_IA64_GR+1
  154. will return the global\-pointer
  155. value for this function.
  156. .TP
  157. UNW_IA64_NAT:
  158. The base\-index for the NaT bits of the
  159. general (integer) registers. A non\-zero value in these registers
  160. corresponds to a set NaT\-bit. Add an index in the range from 0..127
  161. to get a particular NaT\-bit register. For example, to access the
  162. NaT bit of r4,
  163. the index UNW_IA64_NAT+4
  164. should be used.
  165. .TP
  166. UNW_IA64_FR:
  167. The base\-index for floating\-point
  168. registers. Add an index in the range from 0..127 to get a
  169. particular floating\-point register. For example, to access
  170. f2,
  171. the index UNW_IA64_FR+2
  172. should be
  173. used. Registers f0
  174. and f1
  175. are read\-only, and any
  176. attempt to write to indices UNW_IA64_FR+0
  177. or
  178. UNW_IA64_FR+1
  179. will result in an error
  180. (\-UNW_EREADONLYREG).
  181. .TP
  182. UNW_IA64_AR:
  183. The base\-index for application
  184. registers. Add an index in the range from 0..127 to get a
  185. particular application register. For example, to access
  186. ar40,
  187. the index UNW_IA64_AR+40
  188. should be
  189. used. The IA\-64 architecture defines several application registers
  190. as ``reserved for future use\&''\&. Attempting to access such registers
  191. results in an error (\-UNW_EBADREG).
  192. .TP
  193. UNW_IA64_BR:
  194. The base\-index for branch registers.
  195. Add an index in the range from 0..7 to get a particular branch
  196. register. For example, to access b6,
  197. the index
  198. UNW_IA64_BR+6
  199. should be used.
  200. .TP
  201. UNW_IA64_PR:
  202. Contains the set of predicate registers.
  203. This 64\-bit wide register contains registers p0
  204. through
  205. p63
  206. in the ``broad\-side\&'' format. Just like with the
  207. ``move predicates\&'' instruction, the registers are mapped as if
  208. CFM.rrb.pr
  209. were set to 0. Thus, in general the value of
  210. predicate register pN
  211. with N>=16 can be found
  212. in bit 16 + ((N\-16)+CFM.rrb.pr) % 48\&.
  213. .TP
  214. UNW_IA64_CFM:
  215. Contains the current\-frame\-mask
  216. register.
  217. .PP
  218. .SS CONVENIENCE MACROS
  219. .PP
  220. Convenience macros are simply aliases for certain frequently used
  221. registers:
  222. .TP
  223. UNW_IA64_GP:
  224. Alias for UNW_IA64_GR+1,
  225. the global\-pointer register.
  226. .TP
  227. UNW_IA64_TP:
  228. Alias for UNW_IA64_GR+13,
  229. the thread\-pointer register.
  230. .TP
  231. UNW_IA64_AR_RSC:
  232. Alias for UNW_IA64_GR+16,
  233. the register\-stack configuration register.
  234. .TP
  235. UNW_IA64_AR_BSP:
  236. Alias for
  237. UNW_IA64_GR+17\&.
  238. This register index accesses the
  239. value of register ar.bsp
  240. as of the time it was last saved
  241. explicitly. This is rarely what you want. Normally, you\&'ll want to
  242. use UNW_IA64_BSP
  243. instead.
  244. .TP
  245. UNW_IA64_AR_BSPSTORE:
  246. Alias for UNW_IA64_GR+18,
  247. the register\-backing store write pointer.
  248. .TP
  249. UNW_IA64_AR_RNAT:
  250. Alias for UNW_IA64_GR+19,
  251. the register\-backing store NaT\-collection register.
  252. .TP
  253. UNW_IA64_AR_CCV:
  254. Alias for UNW_IA64_GR+32,
  255. the compare\-and\-swap value register.
  256. .TP
  257. UNW_IA64_AR_CSD:
  258. Alias for UNW_IA64_GR+25,
  259. the compare\-and\-swap\-data register (used by 16\-byte atomic operations).
  260. .TP
  261. UNW_IA64_AR_UNAT:
  262. Alias for UNW_IA64_GR+36,
  263. the user NaT\-collection register.
  264. .TP
  265. UNW_IA64_AR_FPSR:
  266. Alias for UNW_IA64_GR+40,
  267. the floating\-point status (and control) register.
  268. .TP
  269. UNW_IA64_AR_PFS:
  270. Alias for UNW_IA64_GR+64,
  271. the previous frame\-state register.
  272. .TP
  273. UNW_IA64_AR_LC:
  274. Alias for UNW_IA64_GR+65
  275. the loop\-count register.
  276. .TP
  277. UNW_IA64_AR_EC:
  278. Alias for UNW_IA64_GR+66,
  279. the epilogue\-count register.
  280. .PP
  281. .SH THE UNWIND\-CONTEXT TYPE
  282. .PP
  283. On IA\-64, unw_context_t
  284. is simply an alias for
  285. ucontext_t
  286. (as defined by the Single UNIX Spec). This implies
  287. that it is possible to initialize a value of this type not just with
  288. unw_getcontext(),
  289. but also with getcontext(),
  290. for
  291. example. However, since this is an IA\-64\-specific extension to
  292. libunwind,
  293. portable code should not rely on this equivalence.
  294. .PP
  295. .SH SEE ALSO
  296. .PP
  297. libunwind(3)
  298. .PP
  299. .SH AUTHOR
  300. .PP
  301. David Mosberger\-Tang
  302. .br
  303. Email: \fBdmosberger@gmail.com\fP
  304. .br
  305. WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
  306. .\" NOTE: This file is generated, DO NOT EDIT.