Home | History | Annotate | Download | only in libasm

Lines Matching refs:asmscn

40 asm_align (asmscn, value)
41 AsmScn_t *asmscn;
44 if (asmscn == NULL)
55 if (unlikely (asmscn->ctx->textp))
57 fprintf (asmscn->ctx->out.file, "\t.align %" PRId32 ", ",
59 if (asmscn->pattern->len == 1)
60 fprintf (asmscn->ctx->out.file, "%02hhx\n", asmscn->pattern->bytes[0]);
63 fputc_unlocked ('"', asmscn->ctx->out.file);
65 for (size_t cnt = 0; cnt < asmscn->pattern->len; ++cnt)
66 fprintf (asmscn->ctx->out.file, "\\x%02hhx",
67 asmscn->pattern->bytes[cnt]);
69 fputs_unlocked ("\"\n", asmscn->ctx->out.file);
74 rwlock_wrlock (asmscn->ctx->lock);
79 if ((asmscn->offset & (value - 1)) != 0)
82 size_t cnt = value - (asmscn->offset & (value - 1));
85 result = __libasm_ensure_section_space (asmscn, cnt);
91 size_t byteptr = asmscn->offset % asmscn->pattern->len;
94 asmscn->offset += cnt;
98 asmscn->content->data[asmscn->content->len++]
99 = asmscn->pattern->bytes[byteptr++];
101 if (byteptr == asmscn->pattern->len)
108 if (asmscn->max_align < value)
110 asmscn->max_align = value;
113 if (asmscn->subsection_id != 0)
115 rwlock_wrlock (asmscn->data.up->ctx->lock);
117 if (asmscn->data.up->max_align < value)
118 asmscn->data.up->max_align = value;
120 rwlock_unlock (asmscn->data.up->ctx->lock);
125 rwlock_unlock (asmscn->ctx->lock);
132 for ASMSCN. */
134 __libasm_ensure_section_space (asmscn, len)
135 AsmScn_t *asmscn;
142 if (asmscn->content == NULL)
147 asmscn->content = (struct AsmData *) malloc (sizeof (struct AsmData)
149 if (asmscn->content == NULL)
152 asmscn->content->next = asmscn->content;
158 if (asmscn->content->maxlen - asmscn->content->len >= len)
162 size = MAX (2 *len, MIN (32768, 2 * asmscn->offset));
168 newp->next = asmscn->content->next;
169 asmscn->content = asmscn->content->next = newp;
172 asmscn->content->len = 0;
173 asmscn->content->maxlen = size;