.. | .. |
---|
1 | 1 | // SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note |
---|
2 | 2 | /* |
---|
3 | 3 | * |
---|
4 | | - * (C) COPYRIGHT 2017-2021 ARM Limited. All rights reserved. |
---|
| 4 | + * (C) COPYRIGHT 2017-2022 ARM Limited. All rights reserved. |
---|
5 | 5 | * |
---|
6 | 6 | * This program is free software and is provided to you under the terms of the |
---|
7 | 7 | * GNU General Public License version 2 as published by the Free Software |
---|
.. | .. |
---|
31 | 31 | #define DEFAULT_MIN_SAMPLE_CYCLES 10000 |
---|
32 | 32 | |
---|
33 | 33 | /** |
---|
34 | | - * read_hwcnt() - read a counter value |
---|
| 34 | + * kbase_ipa_read_hwcnt() - read a counter value |
---|
35 | 35 | * @model_data: pointer to model data |
---|
36 | 36 | * @offset: offset, in bytes, into vinstr buffer |
---|
37 | 37 | * |
---|
.. | .. |
---|
44 | 44 | u32 offset) |
---|
45 | 45 | { |
---|
46 | 46 | u8 *p = (u8 *)model_data->dump_buf.dump_buf; |
---|
| 47 | + u64 val = *(u64 *)&p[offset]; |
---|
47 | 48 | |
---|
48 | | - return *(u32 *)&p[offset]; |
---|
| 49 | + return (val > U32_MAX) ? U32_MAX : (u32)val; |
---|
49 | 50 | } |
---|
50 | 51 | |
---|
51 | 52 | static inline s64 kbase_ipa_add_saturate(s64 a, s64 b) |
---|