Lines Matching +full:header +full:- +full:payload
4 * SPDX-License-Identifier: Apache-2.0
55 uint32_t payload_size; /* Buffer size without packet header. */
60 /* Hostlink packet header. */
63 uint32_t total_size; /* Size of packet including header. */
102 char reserved[HL_MAX_DCACHE_LINE - HL_HEADERS_SZ];
113 /* Payload buffer */
114 volatile union payload_u payload; member
122 * some features which require bigger payload buffer this might become not true.
212 /* Get hostlink payload size (iochunk + reserved space). */
215 return sizeof(__HOSTLINK__.payload); in hl_payload_size()
218 #define ALIGN(x, y) (((x) + ((y) - 1)) & ~((y) - 1))
220 /* Fill hostlink packet header. */
223 hl_write32(&pkt->packet_id, 1); in hl_pkt_init()
224 hl_write32(&pkt->total_size, ALIGN(size, 4) + sizeof(struct hl_pkt_hdr)); in hl_pkt_init()
225 hl_write32(&pkt->priority, 0); in hl_pkt_init()
226 hl_write32(&pkt->type, 0); in hl_pkt_init()
227 hl_write32(&pkt->checksum, 0); in hl_pkt_init()
262 * Wait for host response and return pointer to hostlink payload.
295 hl_write16(&pack->type, PAT_INT); in hl_static_pack_int()
296 hl_write16(&pack->size, 4); in hl_static_pack_int()
297 hl_write32(&pack->value, value); in hl_static_pack_int()
302 hl_write16(&pack->type, PAT_STRING); in hl_static_pack_char()
303 hl_write16(&pack->size, 1); in hl_static_pack_char()
304 hl_write8(&pack->payload_short, c); in hl_static_pack_char()
309 uint16_t type = hl_read16(&pack->type); in hl_static_unpack_int()
310 uint16_t size = hl_read16(&pack->size); in hl_static_unpack_int()
313 return -1; in hl_static_unpack_int()
317 return -1; in hl_static_unpack_int()
320 *value = hl_read32(&pack->value); in hl_static_unpack_int()
329 * in, int -> syscall (HL_SYSCALL_WRITE) in hl_write_char()
330 * in, int -> file descriptor in hl_write_char()
331 * in, ptr -> buffer in hl_write_char()
332 * in, int -> bytes number in hl_write_char()
333 * out, int -> bytes written in hl_write_char()
337 hl_static_pack_int(&__HOSTLINK__.payload.pkt_write_char_put.syscall_nr, HL_SYSCALL_WRITE); in hl_write_char()
339 hl_static_pack_int(&__HOSTLINK__.payload.pkt_write_char_put.fd, fd); in hl_write_char()
341 hl_static_pack_char(&__HOSTLINK__.payload.pkt_write_char_put.buff, c); in hl_write_char()
343 hl_static_pack_int(&__HOSTLINK__.payload.pkt_write_char_put.nbyte, 1); in hl_write_char()
349 int ret = hl_static_unpack_int(&__HOSTLINK__.payload.pkt_write_char_get.byte_written, &bwr); in hl_write_char()
357 ret = -1; in hl_write_char()
371 * @return 0 if a character arrived, -1 if the input buffer if empty.
378 return -1; in uart_hostlink_poll_in()