1/*
2 * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230)
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 */
6
7#pragma once
8
9#include <types.h>
10#include <api/syscall.h>
11#include <object/structures.h>
12
13static inline time_t mode_parseTimeArg(word_t i, word_t *buffer)
14{
15    return (((time_t) getSyscallArg(i + 1, buffer) << 32llu) + getSyscallArg(i, buffer));
16}
17
18static inline word_t mode_setTimeArg(word_t i, time_t time, word_t *buffer, tcb_t *thread)
19{
20    setMR(thread, buffer, i, (uint32_t) time);
21    return setMR(thread, buffer, i + 1, (uint32_t)(time >> 32llu));
22}
23
24