*/
/* Ranges must overlap (start < pos+size && end > pos). */
- if (cmp64(rule->start, add64u(pos, size)) >= 0 ||
+ if (cmp64(rule->start, pos + size) >= 0 ||
(cmp64u(rule->end, 0) && cmp64(rule->end, pos) <= 0))
return FALSE;
/* Which block on disk and how close to EOF? */
if (position >= dv_size) return(total); /* At EOF */
if (position + nbytes > dv_size) nbytes = dv_size - position;
- block = div64u(add64ul(f_dv->dv_base, position), SECTOR_SIZE);
+ block = div64u(f_dv->dv_base + position, SECTOR_SIZE);
if ((nbytes & SECTOR_MASK) != 0) return(EINVAL);
}
/* Book the number of bytes transferred. */
- position= add64u(position, count);
+ position += count;
if ((iov->iov_size -= count) == 0) { iov++; nr_req--; vir_offset = 0; }
}
#include <limits.h>
-static inline u64_t add64(u64_t i, u64_t j)
-{
- return i + j;
-}
-
-static inline u64_t add64u(u64_t i, unsigned j)
-{
- return i + j;
-}
-
-static inline u64_t add64ul(u64_t i, unsigned long j)
-{
- return i + j;
-}
-
static inline int bsr64(u64_t i)
{
int index;
if(_cum_instances == 0) { \
RESET_STATS(_starttime, _cum_instances, _cum_spenttime, _cum_starttime); \
} \
- _next_cum_spent = add64(_cum_spenttime, _dt); \
+ _next_cum_spent = _cum_spenttime + _dt; \
if(ex64hi(_next_cum_spent)) { \
PRINT_STATS(_cum_spenttime, _cum_instances); \
RESET_STATS(_starttime, _cum_instances, _cum_spenttime, _cum_starttime); \
} \
- _cum_spenttime = add64(_cum_spenttime, _dt); \
+ _cum_spenttime += _dt; \
_cum_instances++; \
_cum_dt = sub64(_endtime, _cum_starttime); \
if(cmp64(_cum_dt, make64(0, 120)) > 0) { \
p->p_cycles += tsc_delta;
if(kbill_ipc) {
- kbill_ipc->p_kipc_cycles =
- add64(kbill_ipc->p_kipc_cycles, tsc_delta);
+ kbill_ipc->p_kipc_cycles += tsc_delta;
kbill_ipc = NULL;
}
if(kbill_kcall) {
- kbill_kcall->p_kcall_cycles =
- add64(kbill_kcall->p_kcall_cycles, tsc_delta);
+ kbill_kcall->p_kcall_cycles += tsc_delta;
kbill_kcall = NULL;
}
idl->p_cycles = make64(0, 0);
for (i = 0; i < CONFIG_MAX_CPUS ; i++) {
- idl->p_cycles = add64(idl->p_cycles,
- get_cpu_var(i, idle_proc).p_cycles);
+ idl->p_cycles += get_cpu_var(i, idle_proc).p_cycles;
}
}
u64_t hgfstime;
if (tsp != NULL) {
- hgfstime = add64ul(mul64u(tsp->tv_sec, 10000000), tsp->tv_nsec / 100);
- hgfstime = add64(hgfstime, time_offset);
+ hgfstime = mul64u(tsp->tv_sec, 10000000) + (tsp->tv_nsec / 100);
+ hgfstime += time_offset;
RPC_NEXT32 = ex64lo(hgfstime);
RPC_NEXT32 = ex64hi(hgfstime);
count -= chunk;
off += chunk;
- pos = add64u(pos, chunk);
+ pos += chunk;
}
if (r < 0)
count -= r;
off += r;
- pos = add64u(pos, r);
+ pos += r;
}
if (r < 0)
/* Calculate "small" difference. */
spent = sub64(stop, cprof_stk[cprof_stk_top].start_2);
- cprof_stk[cprof_stk_top].slot->cycles =
- add64(cprof_stk[cprof_stk_top].slot->cycles,
- sub64(spent, cprof_stk[cprof_stk_top].spent_deeper));
+ cprof_stk[cprof_stk_top].slot->cycles +=
+ sub64(spent, cprof_stk[cprof_stk_top].spent_deeper);
/* Clear spent_deeper for call level we're leaving. */
cprof_stk[cprof_stk_top].spent_deeper = ((u64_t)(0));
spent = sub64(stop, cprof_stk[cprof_stk_top].start_1);
cprof_stk_top--; /* decrease stack */
if (cprof_stk_top >= 0) /* don't update non-existent level -1 */
- cprof_stk[cprof_stk_top].spent_deeper =
- add64(cprof_stk[cprof_stk_top].spent_deeper, spent);
+ cprof_stk[cprof_stk_top].spent_deeper += spent;
cprof_locked = 0;
}
CALIBRATE;
/* We have to know when to end the delay. */
- end = add64(now, mul64u(micros, calib_mhz));
+ end = now + mul64u(micros, calib_mhz);
/* If we have to wait for at least one HZ tick, use the regular
* tickdelay first. Round downwards on purpose, so the average
set_time(struct timespec *tsp)
{
- return add64u(mul64u(tsp->tv_sec, 1000000000), tsp->tv_nsec);
+ return mul64u(tsp->tv_sec, 1000000000) + tsp->tv_nsec;
}
/*
if (rdwt_err < 0) break;
/* Update counters and pointers. */
- nrbytes -= chunk; /* bytes yet to be read */
- cum_io += chunk; /* bytes read so far */
- position = add64ul(position, chunk); /* position within the file */
+ nrbytes -= chunk; /* bytes yet to be read */
+ cum_io += chunk; /* bytes read so far */
+ position += chunk; /* position within the file */
}
fs_m_out.RES_SEEK_POS_LO = ex64lo(position);
if (rdwt_err < 0) break;
/* Update counters and pointers. */
- nrbytes -= chunk; /* bytes yet to be read */
- cum_io += chunk; /* bytes read so far */
- position= add64ul(position, chunk); /* position within the file */
+ nrbytes -= chunk; /* bytes yet to be read */
+ cum_io += chunk; /* bytes read so far */
+ position += chunk; /* position within the file */
}
fs_m_out.RES_SEEK_POS_LO = ex64lo(position);
/* I dont need to save anything about it */
vol_ok = TRUE;
- offset = add64u(offset,ISO9660_MIN_BLOCK_SIZE);
+ offset += ISO9660_MIN_BLOCK_SIZE;
}
if (vol_ok == FALSE)
if (lmfs_rdwt_err() < 0) break;
/* Update counters and pointers. */
- nrbytes -= chunk; /* bytes yet to be read */
- cum_io += chunk; /* bytes read so far */
- position = add64ul(position, chunk); /* position within the file */
+ nrbytes -= chunk; /* bytes yet to be read */
+ cum_io += chunk; /* bytes read so far */
+ position += chunk; /* position within the file */
}
fs_m_out.RES_SEEK_POS_LO = ex64lo(position);
}
if (offset >= 0)
- newpos = add64ul(pos, offset);
+ newpos = pos + offset;
else
newpos = sub64ul(pos, -offset);
suspend_reopen);
if (r >= 0) {
cum_io = r;
- position = add64ul(position, r);
+ position += r;
r = OK;
}
} else if (S_ISBLK(vp->v_mode)) { /* Block special files. */
if (cmp64(mul64(mul64(i, j), k), mul64(i, mul64(j, k))) != 0) ERR;
/* left and right distributivity */
- if (cmp64(mul64(add64(i, j), k), add64(mul64(i, k), mul64(j, k))) != 0) ERR;
- if (cmp64(mul64(i, add64(j, k)), add64(mul64(i, j), mul64(i, k))) != 0) ERR;
+ if (cmp64(mul64(i + j, k), mul64(i, k) + mul64(j, k)) != 0) ERR;
+ if (cmp64(mul64(i, j + k), mul64(i, j) + mul64(i, k)) != 0) ERR;
}
}
}
/* check results using i = q j + r and r < j */
- if (cmp64(i, add64(mul64(q, j), r)) != 0) ERR;
+ if (cmp64(i, mul64(q, j) + r) != 0) ERR;
if (cmp64(r, j) >= 0) ERR;
}
d = div64u(bytes, block_size);
rem = rem64u(bytes, block_size);
- resize = add64u(mul64u(d, block_size), rem);
+ resize = mul64u(d, block_size) + rem;
if(cmp64(resize, bytes) != 0) {
/* Assume block_t is unsigned */
d = (block_t)(-1ul);