DIV_ROUND_UP is only used within OpenOCD.
 
Symbols
loading...
Files
loading...

DIV_ROUND_UP macro

Rounds @c m up to the nearest multiple of @c n using division.

Syntax

#define DIV_ROUND_UP(m, n) (((m) + (n) - 1) / (n))

Arguments

m

The value to round up to @c n.

n

Round @c m up to a multiple of this number.

Return value

The rounded integer value.

References

LocationText
types.h:79
#define DIV_ROUND_UP(m, n) (((m) + (n) - 1) / (n))
algorithm.c:33
param->value = malloc(DIV_ROUND_UP(size, 8));
arm_adi_v5.c:529
unsigned int drw_ops = DIV_ROUND_UP(this_size, 4);
arm_adi_v5.c:651
unsigned int drw_ops = DIV_ROUND_UP(this_size, 4);
at91sam7.c:928
last_page = DIV_ROUND_UP(offset + count, dst_min_alignment);
at91sam7.c:948
wcount = DIV_ROUND_UP(count, 4);
batch.c:16
#define DMI_SCAN_BUF_SIZE (DIV_ROUND_UP(DMI_SCAN_MAX_BIT_LENGTH, 8))
binarybuffer.c:49
memcpy(_to, from, DIV_ROUND_UP(size, 8));
binarybuffer.c:180
unsigned len_bytes = DIV_ROUND_UP(buf_len, 8);
binarybuffer.c:241
const size_t buf_len = DIV_ROUND_UP(buf_bitsize, 8);
bits.h:26
#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long))
cfi.c:2786
cfi_info->word_write_timeout = DIV_ROUND_UP((1L << cfi_info->word_write_timeout_typ) *
cfi.c:2788
cfi_info->buf_write_timeout = DIV_ROUND_UP((1L << cfi_info->buf_write_timeout_typ) *
cmsis_dap.c:433
int retval = cmsis_dap_xfer(cmsis_dap_handle, 2 + DIV_ROUND_UP(s_len, 8));
cmsis_dap.c:1682
unsigned int cmd_len = 1 + DIV_ROUND_UP(s_len, 8);
cmsis_dap.c:1698
memset(&queued_seq_buf[queued_seq_buf_end + 1], 0, DIV_ROUND_UP(s_len, 8));
cmsis_dap.c:1705
queued_seq_tdo_ptr += DIV_ROUND_UP(s_len, 8);
commands.c:163
commands.c:195
*buffer = calloc(1, DIV_ROUND_UP(bit_count, 8));
commands.c:245
malloc(DIV_ROUND_UP(num_bits, 8)), 0, num_bits);
core.c:1352
ir_test = malloc(DIV_ROUND_UP(total_ir_length, 8));
core.c:1454
ir_len_bytes = DIV_ROUND_UP(ir_len_bits, 8);
driver.c:89
uint8_t *v = cmd_queue_alloc(DIV_ROUND_UP(tap->ir_length, 8));
driver.c:93
field->out_value = buf_set_ones(cmd_queue_alloc(DIV_ROUND_UP(tap->ir_length, 8)), tap->ir_length);
driver.c:204
out_fields->out_value = buf_cpy(out_bits, cmd_queue_alloc(DIV_ROUND_UP(num_bits, 8)), num_bits);
driver.c:253
cmd_queue_alloc(DIV_ROUND_UP(num_bits, 8)), num_bits);
efinix.c:61
bit_file->length = DIV_ROUND_UP(length, 3);
efinix.c:127
void *t = calloc(DIV_ROUND_UP(field.num_bits, 8), 1);
esirisc.c:1452
reg->value = calloc(1, DIV_ROUND_UP(esirisc->num_bits, 8));
esirisc.c:1471
reg->value = calloc(1, DIV_ROUND_UP(esirisc->num_bits, 8));
esirisc_flash.c:336
uint32_t max_bytes = DIV_ROUND_UP(esirisc->num_bits, 8);
esirisc_jtag.c:131
int num_in_bytes = DIV_ROUND_UP(num_in_bits, 8);
etb.c:43
void *t = calloc(DIV_ROUND_UP(field.num_bits, 8), 1);
etb.c:63
void *t = calloc(DIV_ROUND_UP(field.num_bits, 8), 1);
fm4.c:208
uint32_t halfword_count = DIV_ROUND_UP(byte_count, 2);
ftdi.c:112
uint8_t trn_ack_data_parity_trn[DIV_ROUND_UP(4 + 3 + 32 + 1 + 4, 8)];
gatemate.c:166
void *t = calloc(DIV_ROUND_UP(field.num_bits, 8), 1);
gdb_server.c:1187
buf_len = DIV_ROUND_UP(reg->size, 8);
gdb_server.c:1225
const unsigned int len = DIV_ROUND_UP(reg->size, 8) * 2;
gdb_server.c:1267
reg_packet_size += DIV_ROUND_UP(reg_list[i]->size, 8) * 2;
gdb_server.c:1288
reg_packet_p += DIV_ROUND_UP(reg_list[i]->size, 8) * 2;
gdb_server.c:1341
int chars = (DIV_ROUND_UP(reg_list[i]->size, 8) * 2);
gdb_server.c:1346
bin_buf = malloc(DIV_ROUND_UP(reg_list[i]->size, 8));
gdb_server.c:1399
reg_packet = calloc(DIV_ROUND_UP(reg_list[reg_num]->size, 8) * 2 + 1, 1); /* plus one for string termination null */
gdb_server.c:1409
gdb_put_packet(connection, reg_packet, DIV_ROUND_UP(reg_list[reg_num]->size, 8) * 2);
gdb_server.c:1461
if (chars != (DIV_ROUND_UP(reg_list[reg_num]->size, 8) * 2)) {
gowin.c:203
void *t = calloc(DIV_ROUND_UP(field.num_bits, 8), 1);
gowin.c:295
int cycles = DIV_ROUND_UP(speed, frac_sec);
hwthread.c:284
DIV_ROUND_UP(reg_list[i]->size, 8));
intel.c:79
void *t = calloc(DIV_ROUND_UP(field.num_bits, 8), 1);
intel.c:99
unsigned int cycles = DIV_ROUND_UP(speed, 200);
intel.c:153
uint8_t *buf = calloc(DIV_ROUND_UP(intel_info->boundary_scan_length, 8), 1);
intel.c:193
jtag_add_runtest(DIV_ROUND_UP(512ul * speed, 125ul) + 512, TAP_IDLE);
intel.c:196
jtag_add_runtest(DIV_ROUND_UP(64ul * speed, 125ul) + 512, TAP_IDLE);
interface.c:396
tap_bytes = DIV_ROUND_UP(tap_bits, 8);
ipdbg.c:301
const size_t dreg_buffer_size = DIV_ROUND_UP(data_register_length, 8);
ipdbg.c:311
new_hub->scratch_memory.vir_out_val = calloc(1, DIV_ROUND_UP(virtual_ir->length, 8));
ipdbg.c:348
uint8_t *ir_out_val = calloc(DIV_ROUND_UP(tap->ir_length, 8), 1);
ipdbg.c:458
const size_t dreg_buffer_size = DIV_ROUND_UP(hub->data_register_length, 8);
ipdbg.c:520
const size_t dreg_buffer_size = DIV_ROUND_UP(hub->data_register_length, 8);
jlink.c:2218
uint8_t data_parity_trn[DIV_ROUND_UP(32 + 1, 8)];
lattice.c:66
void *t = calloc(DIV_ROUND_UP(field.num_bits, 8), 1);
lattice.c:150
size_t sz_bytes = DIV_ROUND_UP(lattice_device->preload_length, 8);
lpc2000.c:1075
if (offset + DIV_ROUND_UP(count, dst_min_alignment) * dst_min_alignment > bank->sectors[i].offset)
ls1_sap.c:96
uint8_t *t = calloc(DIV_ROUND_UP(field.num_bits, 8), 1);
minidriver_imp.h:16
unsigned num_bytes = DIV_ROUND_UP(field->num_bits, 8);
mpsse.c:471
ctx->write_count += DIV_ROUND_UP(bit_count, 8);
mpsse.c:482
ctx->read_count += DIV_ROUND_UP(bit_count, 8);
mpsse.c:800
unsigned num_packets = DIV_ROUND_UP(transfer->actual_length, packet_size);
osbdm.c:40
next->tms = calloc(1, DIV_ROUND_UP(len, 8));
osbdm.c:214
int swap_count = DIV_ROUND_UP(length, 16);
osbdm.c:291
uint8_t tms[DIV_ROUND_UP(OSBDM_SWAP_MAX, 8)];
osbdm.c:292
uint8_t tdi[DIV_ROUND_UP(OSBDM_SWAP_MAX, 8)];
osbdm.c:293
uint8_t tdo[DIV_ROUND_UP(OSBDM_SWAP_MAX, 8)];
osbdm.c:469
(void)memset(next->tms, 0xff, DIV_ROUND_UP(count, 8));
osbdm.c:518
(void)memset(next->tms, 0, DIV_ROUND_UP(fields[idx].num_bits, 8));
picoprobe.c:50
uint8_t trn_ack_data_parity_trn[DIV_ROUND_UP(4 + 3 + 32 + 1 + 4, 8)];
picoprobe.c:136
unsigned length_bytes = DIV_ROUND_UP(q->bits, 8);
picoprobe.c:198
unsigned read_bytes = DIV_ROUND_UP(read_hdr->bits, 8);
psoc5lp.c:952
psoc5lp.c:1319
for (i = 0; i < DIV_ROUND_UP(bank->size, BLOCK_SIZE); i++) {
psoc5lp.c:1392
bank->num_sectors = DIV_ROUND_UP(bank->size, SECTOR_SIZE);
riscv-013.c:1933
*debug_vl = DIV_ROUND_UP(r->vlenb * 8, riscv_xlen(target));
riscv.c:3743
memcpy(reg->value, buf, DIV_ROUND_UP(reg->size, 8));
riscv.c:4411
r->value = calloc(1, DIV_ROUND_UP(r->size, 8));
rtos.c:484
num_bytes += DIV_ROUND_UP(reg_list[i].size, 8) * 2;
rtos.c:490
size_t count = DIV_ROUND_UP(reg_list[i].size, 8);
str9xpec.c:80
void *t = calloc(DIV_ROUND_UP(field.num_bits, 8), 1);
str9xpec.c:314
buffer = calloc(DIV_ROUND_UP(64, 8), 1);
str9xpec.c:395
buffer = calloc(DIV_ROUND_UP(64, 8), 1);
str9xpec.c:609
scanbuf = calloc(DIV_ROUND_UP(64, 8), 1);
str9xpec.c:725
buffer = calloc(DIV_ROUND_UP(32, 8), 1);
svf.c:253
int byte_len = DIV_ROUND_UP(bit_len, 8);
target.c:3140
uint8_t *buf = malloc(DIV_ROUND_UP(reg->size, 8));
target.c:4942
uint8_t *buf = malloc(DIV_ROUND_UP(reg->size, 8));
target_request.c:39
char *msg = malloc(DIV_ROUND_UP(length + 1, 4) * 4);
target_request.c:42
target->type->target_request_data(target, DIV_ROUND_UP(length, 4), (uint8_t *)msg);
target_request.c:64
uint8_t *data = malloc(DIV_ROUND_UP(length * size, 4) * 4);
target_request.c:72
target->type->target_request_data(target, DIV_ROUND_UP(length * size, 4), (uint8_t *)data);
tcl.c:85
void *t = malloc(DIV_ROUND_UP(bits, 8));
tcl.c:977
uint8_t *v = calloc(1, DIV_ROUND_UP(field_size, 8));
ulink.c:876
scan_size_bytes = DIV_ROUND_UP(scan_size_bits, 8);
ulink.c:1463
scan_size_bytes = DIV_ROUND_UP(scan_size_bits, 8);
usb_blaster.c:667
memcpy(bits, tdos, DIV_ROUND_UP(nb_bits, 8));
usb_blaster.c:716
log_buf = hexdump(buf, DIV_ROUND_UP(scan_bits, 8));
virtex2.c:36
void *t = calloc(DIV_ROUND_UP(field.num_bits, 8), 1);
vsllink.c:148
vsllink_debug_buffer(buffer, DIV_ROUND_UP(scan_size, 8));
vsllink.c:642
vsllink_debug_buffer(buffer + dest_first / 8, DIV_ROUND_UP(length, 7));
xds110.c:784
uint16_t total_bytes = DIV_ROUND_UP(shift_bits, 8);
xds110.c:1564
bytes = DIV_ROUND_UP(bits, 8);
xds110.c:1600
bytes = DIV_ROUND_UP(bits, 8);
xds110.c:1724
total_bytes = DIV_ROUND_UP(total_bits, 8);
xmc1xxx.c:247
uint32_t block_count = DIV_ROUND_UP(byte_count, NVM_BLOCK_SIZE);
xsvf.c:477
field.in_value = calloc(DIV_ROUND_UP(field.num_bits, 8), 1);
xsvf.c:917
field.in_value = calloc(DIV_ROUND_UP(field.num_bits, 8), 1);
xtensa.c:539
unsigned int oplenw = DIV_ROUND_UP(oplen, sizeof(uint32_t));