arm-trusted-firmware/include/drivers/delay_timer.h
Maheedhar Bollapalli 472cccb5f9 fix(delay-timer): create unique variable name
This corrects the MISRA violation C2012-5.7:
A tag name shall be a unique identifier.
Renamed the variable to ensure uniqueness.

Change-Id: Ibadebf8fd5206eb079535d2775d1877b42f1eab7
Signed-off-by: Nithin G <nithing@amd.com>
Signed-off-by: Maheedhar Bollapalli <maheedharsai.bollapalli@amd.com>
2025-03-09 22:08:48 +05:30

38 lines
1.1 KiB
C

/*
* Copyright (c) 2015-2024, Arm Limited and Contributors. All rights reserved.
* Copyright (c) 2019, Linaro Limited
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef DELAY_TIMER_H
#define DELAY_TIMER_H
#include <stdbool.h>
#include <stdint.h>
#include <arch_helpers.h>
/********************************************************************
* A simple timer driver providing synchronous delay functionality.
* The driver must be initialized with a structure that provides a
* function pointer to return the timer value and a clock
* multiplier/divider. The ratio of the multiplier and the divider is
* the clock period in microseconds.
********************************************************************/
typedef struct timer_operation {
uint32_t (*get_timer_value)(void);
uint32_t clk_mult;
uint32_t clk_div;
uint64_t (*timeout_init_us)(uint32_t usec);
bool (*timeout_elapsed)(uint64_t cnt);
} timer_ops_t;
uint64_t timeout_init_us(uint32_t usec);
bool timeout_elapsed(uint64_t cnt);
void mdelay(uint32_t msec);
void udelay(uint32_t usec);
void timer_init(const timer_ops_t *ops_ptr);
#endif /* DELAY_TIMER_H */