Sandrine Bailleux | 3cd87d7 | 2018-10-09 11:12:55 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2018, Arm Limited. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #ifndef __SYSTEM_TIMER_H__ |
| 8 | #define __SYSTEM_TIMER_H__ |
| 9 | |
Antonio Nino Diaz | 09a00ef | 2019-01-11 13:12:58 +0000 | [diff] [blame^] | 10 | #include <stdint.h> |
| 11 | |
Sandrine Bailleux | 3cd87d7 | 2018-10-09 11:12:55 +0200 | [diff] [blame] | 12 | /* |
| 13 | * Program systimer to fire an interrupt after time_out_ms |
| 14 | * |
| 15 | * Always return 0 |
| 16 | */ |
| 17 | int program_systimer(unsigned long time_out_ms); |
| 18 | /* |
| 19 | * Cancel the currently programmed systimer interrupt |
| 20 | * |
| 21 | * Always return 0 |
| 22 | */ |
| 23 | int cancel_systimer(void); |
| 24 | /* |
| 25 | * Initialises the systimer so that it can be used for programming timer |
| 26 | * interrupt. |
| 27 | * Must be called by the primary CPU only. |
| 28 | * |
| 29 | * Always return 0 |
| 30 | */ |
| 31 | int init_systimer(uintptr_t systimer_base); |
| 32 | /* |
| 33 | * Handler to acknowledge and de-activate the systimer interrupt |
| 34 | * |
| 35 | * Always return 0 |
| 36 | */ |
| 37 | int handler_systimer(void); |
| 38 | |
| 39 | #endif /* __SYSTEM_TIMER_H__ */ |