123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- #include "thread_dbP.h"
- td_err_e
- td_thr_getgregs (const td_thrhandle_t *th, prgregset_t regset)
- {
- psaddr_t cancelhandling, tid;
- td_err_e err;
- LOG ("td_thr_getgregs");
- if (th->th_unique == 0)
-
- return ps_lgetregs (th->th_ta_p->ph, ps_getpid (th->th_ta_p->ph),
- regset) != PS_OK ? TD_ERR : TD_OK;
-
- err = DB_GET_FIELD (cancelhandling, th->th_ta_p, th->th_unique, pthread,
- cancelhandling, 0);
- if (err != TD_OK)
- return err;
-
- if (((int) (uintptr_t) cancelhandling) & TERMINATED_BITMASK)
- memset (regset, '\0', sizeof (*regset));
-
- else
- {
- err = DB_GET_FIELD (tid, th->th_ta_p, th->th_unique, pthread, tid, 0);
- if (err != TD_OK)
- return err;
- if (ps_lgetregs (th->th_ta_p->ph, (uintptr_t) tid, regset) != PS_OK)
- return TD_ERR;
- }
- return TD_OK;
- }
|