Files
linux-nvgpu/nvsched/include/nvs/impl-internal.h
Konsta Hölttä bfd7fc8649 nvsched: Initial core data
Add software scheduler and domain data structures for a general
scheduler and bookkeeping code to create, remove and list them and to
keep logs for debugging and development; as a first step, this will only
serve as the heart of nvgpu-internal domain scheduler.

Long term, this code is intended to work in arbitrary configurations -
running on GSP, CPU, or elsewhere, and controlling the GPU or something
else.

Jira NVGPU-6427

Change-Id: I2a1577fa9120bb8ae6b9552dd2a187cb2cdfe504
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Signed-off-by: Konsta Hölttä <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2632286
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-12-07 07:06:49 -08:00

90 lines
2.2 KiB
C

/*
* Copyright (c) 2021 NVIDIA Corporation. All rights reserved.
*
* NVIDIA Corporation and its licensors retain all intellectual property
* and proprietary rights in and to this software, related documentation
* and any modifications thereto. Any use, reproduction, disclosure or
* distribution of this software and related documentation without an express
* license agreement from NVIDIA Corporation is strictly prohibited.
*/
#ifndef NVS_IMPL_INTERNAL_H
#define NVS_IMPL_INTERNAL_H
/*
* Each implementation of the nvsched code needs to provide a few basic
* functions to use for interaction with the environment. Things such as
* memory allocation and de-allocation.
*
* These should be provided to nvsched as macro definitions as laid out
* below. Each implementation should provide an impl.h header file in an
* accessible header include path that defines these macros.
*/
#include "impl.h"
#ifndef nvs_malloc
#error "Missing impl def: nvs_malloc()"
#else
/**
* @brief Allocate and return a pointer to memory.
*
* @param size Size of the memory in bytes.
*
* @return A void pointer to memory containing \a size
* bytes of available memory.
*
* Implementation notes: This may allocate more memory than is strictly
* needed. The \a size argument is an unsigned 64 bit type, u64.
*
* #define nvs_malloc(sched, size)
*/
#endif
#ifndef nvs_free
#error "Missing impl def: nvs_free()"
#else
/**
* @brief Free a ptr created with nvs_malloc().
*
* #define nvs_free(sched, ptr)
*/
#endif
#ifndef nvs_memset
#error "Missing impl def: nvs_memset()"
#else
/**
* @brief Set contents of \a ptr to \a value.
*
* #define nvs_memset(ptr, value, size)
*/
#endif
#ifndef nvs_timestamp
#error "Missing impl def: nvs_timestamp()"
#else
/**
* @brief Return the current time in _nanoseconds_. Expected return is a s64; this
* makes it easier on Linux.
*
* #define nvs_timestamp()
*/
#endif
#ifndef nvs_log
#error "Missing impl def: nvs_timestamp()"
#else
/**
* @brief Print a log message; log messages are by definition informational. They
* are likely going to be printed to a uart or something similar so will be very
* slow.
*
* It is up to the integrator to turn them on and off as needed.
*
* #define nvs_log(sched, fmt, ...)
*/
#endif
#endif