Lines Matching refs:hp

560 	helper_t *hp, *hpend;
575 for (hp = old->helper; hp != hpend; hp++) {
576 if (hp->lzbuf != NULL)
577 kmem_free(hp->lzbuf, PAGESIZE);
578 if (hp->page != NULL)
579 kmem_free(hp->page, PAGESIZE);
652 for (hp = new->helper; hp != hpend; hp++) {
653 hp->tag = tag++;
654 if (hp < &new->helper[MINHELPERS]) {
655 hp->lzbuf = kmem_alloc(PAGESIZE, KM_SLEEP);
656 hp->page = kmem_alloc(PAGESIZE, KM_SLEEP);
907 helper_t *hp, *ohp;
1035 for (hp = cfg->helper; hp < endhp; hp++) {
1037 /* Skip preallocated helpers by checking hp->page. */
1038 if (hp->page == NULL) {
1043 hp->page = cfg->maxvm + sz;
1045 hp->lzbuf = cfg->maxvm + sz;
1050 hp->page = ohp->lzbuf;
1058 hp->page = cfg->maxvm + sz;
1084 hp->page = NULL;
1087 hp->bzstream.opaque = &sz;
1088 hp->bzstream.bzalloc = dumpbzalloc;
1089 hp->bzstream.bzfree = dumpbzfree;
1090 (void) BZ2_bzCompressInit(&hp->bzstream,
1092 hp->bzstream.opaque = NULL;
1762 dumpsys_errmsg(helper_t *hp, const char *fmt, ...)
1764 dumpsync_t *ds = hp->ds;
1765 cbuf_t *cp = hp->cperr;
1768 if (hp->helper == MAINHELPER) {
1781 hp->cperr = NULL;
1784 if (hp->cperr == NULL) {
1786 hp->cperr = cp;
1795 hp->cperr = NULL;
1806 dumpsys_swrite(helper_t *hp, cbuf_t *cp, size_t used)
1808 dumpsync_t *ds = hp->ds;
1810 if (hp->helper == MAINHELPER) {
1829 dumpsys_copy_page(helper_t *hp, int offset)
1831 cbuf_t *cp = hp->cpin;
1837 ueoff = dump_pagecopy(cp->buf + cp->off + offset, hp->page);
1843 dumpsys_errmsg(hp, "cpu %d: memory error at PA 0x%08x.%08x\n",
1865 * done. Return 1 when a page has been copied into hp->page.
1868 dumpsys_sread(helper_t *hp)
1870 dumpsync_t *ds = hp->ds;
1876 if (hp->cpin == NULL) {
1877 HRSTART(hp->perpage, inwait);
1881 hp->cpin = CQ_GET(helperq);
1888 if (hp->cpin == NULL)
1901 hp->cpin->used = 0;
1902 CQ_PUT(mainq, hp->cpin, CBUF_USEDMAP);
1904 HRSTOP(hp->perpage, inwait);
1907 if (hp->cpin == NULL)
1911 hp->in = 0;
1914 hp->used = 0;
1918 if (hp->used < hp->cpin->used) {
1924 ASSERT(hp->in != -1);
1925 HRSTART(hp->perpage, copy);
1926 hp->in = dumpsys_copy_page(hp, hp->in);
1927 hp->used += PAGESIZE;
1928 HRSTOP(hp->perpage, copy);
1937 if (panicstr && hp->helper != MAINHELPER)
1939 hp->cpin->buf, hp->cpin->size);
1940 dumpsys_errmsg(hp, NULL);
1941 CQ_PUT(mainq, hp->cpin, CBUF_USEDMAP);
1942 hp->cpin = NULL;
1946 return (hp->cpin != NULL);
1956 dumpsys_bzrun(helper_t *hp, void *buf, size_t size, int mode)
1958 dumpsync_t *ds = hp->ds;
1960 bz_stream *ps = &hp->bzstream;
1979 if (hp->cpout == NULL) {
1980 HRSTART(hp->perpage, outwait);
1981 hp->cpout = CQ_GET(freebufq);
1982 HRSTOP(hp->perpage, outwait);
1983 ps->avail_out = hp->cpout->size - CSIZE;
1984 ps->next_out = hp->cpout->buf + CSIZE;
1988 HRSTART(hp->perpage, compress);
1990 HRSTOP(hp->perpage, compress);
1994 dumpsys_errmsg(hp, "%d: BZ_RUN error %s at page %lx\n",
1995 hp->helper, BZ2_bzErrorString(rc),
1996 hp->cpin->pagenum);
2002 csize = hp->cpout->size - CSIZE - ps->avail_out;
2003 cs = DUMP_SET_TAG(csize, hp->tag);
2005 (void) memcpy(hp->cpout->buf, &cs, CSIZE);
2006 dumpsys_swrite(hp, hp->cpout, csize + CSIZE);
2007 hp->cpout = NULL;
2016 dumpsys_errmsg(hp, "%d: BZ_FINISH error %s\n",
2017 hp->helper, BZ2_bzErrorString(rc));
2027 (void) BZ2_bzCompressReset(&hp->bzstream);
2030 if (hp->cpout != NULL) {
2031 hp->cpout->used = 0;
2032 CQ_PUT(mainq, hp->cpout, CBUF_ERRMSG);
2033 hp->cpout = NULL;
2039 dumpsys_bz2compress(helper_t *hp)
2041 dumpsync_t *ds = hp->ds;
2047 hp->cpin = NULL;
2048 hp->cpout = NULL;
2049 hp->cperr = NULL;
2050 hp->in = 0;
2051 hp->out = 0;
2052 hp->bzstream.avail_in = 0;
2058 while (dumpsys_sread(hp)) {
2059 if (sh.stream_pagenum != hp->cpin->pagenum) {
2060 sh.stream_pagenum = hp->cpin->pagenum;
2061 sh.stream_npages = btop(hp->cpin->used);
2062 dumpsys_bzrun(hp, &sh, sizeof (sh), BZ_RUN);
2064 dumpsys_bzrun(hp, hp->page, PAGESIZE, 0);
2069 dumpsys_bzrun(hp, NULL, 0, BZ_FINISH);
2070 dumpsys_errmsg(hp, NULL);
2073 ASSERT(hp->cpin == NULL && hp->cpout == NULL && hp->cperr == NULL);
2084 * hp->cpout is the buffer we are flushing or filling
2085 * hp->out is the next index to fill data
2089 dumpsys_lzjbrun(helper_t *hp, size_t csize, void *buf, size_t size)
2091 dumpsync_t *ds = hp->ds;
2097 if (size == 0 && hp->cpout == NULL)
2102 hp->cpout != NULL && hp->out + osize > hp->cpout->size) {
2105 cs = DUMP_SET_TAG(hp->out - CSIZE, hp->tag);
2106 (void) memcpy(hp->cpout->buf, &cs, CSIZE);
2109 dumpsys_swrite(hp, hp->cpout, hp->out);
2112 hp->cpout = NULL;
2120 if (hp->cpout == NULL) {
2121 HRSTART(hp->perpage, outwait);
2122 hp->cpout = CQ_GET(freebufq);
2123 HRSTOP(hp->perpage, outwait);
2124 hp->out = CSIZE;
2130 (void) memcpy(hp->cpout->buf + hp->out, &cs, CSIZE);
2131 hp->out += CSIZE;
2135 (void) memcpy(hp->cpout->buf + hp->out, buf, size);
2136 hp->out += size;
2140 dumpsys_lzjbcompress(helper_t *hp)
2142 dumpsync_t *ds = hp->ds;
2149 hp->cpin = NULL;
2150 hp->cpout = NULL;
2151 hp->cperr = NULL;
2152 hp->in = 0;
2153 hp->out = 0;
2159 while (dumpsys_sread(hp)) {
2162 if (sh.stream_pagenum != hp->cpin->pagenum) {
2163 sh.stream_pagenum = hp->cpin->pagenum;
2164 sh.stream_npages = btop(hp->cpin->used);
2165 dumpsys_lzjbrun(hp, 0, &sh, sizeof (sh));
2169 HRSTART(hp->perpage, compress);
2170 csize = compress(hp->page, hp->lzbuf, PAGESIZE);
2171 HRSTOP(hp->perpage, compress);
2175 dumpsys_lzjbrun(hp, csize, hp->lzbuf, csize);
2180 dumpsys_lzjbrun(hp, 0, NULL, 0);
2181 dumpsys_errmsg(hp, NULL);
2184 ASSERT(hp->cpin == NULL && hp->cpout == NULL && hp->cperr == NULL);
2215 helper_t *hp, *hpend = &dumpcfg.helper[dumpcfg.nhelper];
2217 for (hp = dumpcfg.helper; hp != hpend; hp++) {
2218 if (hp->helper == FREEHELPER) {
2219 hp->helper = CPU->cpu_id;
2225 dumpsys_lzjbcompress(hp);
2227 dumpsys_bz2compress(hp);
2229 hp->helper = DONEHELPER;
2262 helper_t *hp = arg;
2266 dumpsys_lzjbcompress(hp);
2268 dumpsys_bz2compress(hp);
2275 dumpsys_lzjb_page(helper_t *hp, cbuf_t *cp)
2277 dumpsync_t *ds = hp->ds;
2280 hp->helper = MAINHELPER;
2281 hp->in = 0;
2282 hp->used = 0;
2283 hp->cpin = cp;
2284 while (hp->used < cp->used) {
2285 HRSTART(hp->perpage, copy);
2286 hp->in = dumpsys_copy_page(hp, hp->in);
2287 hp->used += PAGESIZE;
2288 HRSTOP(hp->perpage, copy);
2290 HRSTART(hp->perpage, compress);
2291 csize = compress(hp->page, hp->lzbuf, PAGESIZE);
2292 HRSTOP(hp->perpage, compress);
2294 HRSTART(hp->perpage, write);
2296 dumpvp_write(hp->lzbuf, csize);
2297 HRSTOP(hp->perpage, write);
2299 CQ_PUT(mainq, hp->cpin, CBUF_USEDMAP);
2300 hp->cpin = NULL;
2566 helper_t *hp, *hpend = &cfg->helper[cfg->nhelper];
2634 for (hp = cfg->helper; hp != hpend; hp++) {
2635 #define PERPAGE(x) ds->perpage.x += hp->perpage.x;
2672 helper_t *hp, *hpend = &dumpcfg.helper[dumpcfg.nhelper];
2884 for (hp = dumpcfg.helper; hp != hpend; hp++) {
2885 if (hp->page == NULL) {
2886 hp->helper = DONEHELPER;
2890 hp->helper = FREEHELPER;
2891 hp->taskqid = NULL;
2892 hp->ds = ds;
2893 bzero(&hp->perpage, sizeof (hp->perpage));
2895 (void) BZ2_bzCompressReset(&hp->bzstream);
2922 for (hp = dumpcfg.helper; hp != hpend; hp++) {
2923 if (hp->page == NULL)
2925 hp->helper = hp - dumpcfg.helper;
2926 hp->taskqid = taskq_dispatch(livetaskq,
2927 dumpsys_live_helper, (void *)hp, TQ_NOSLEEP);