2 * Copyright (C) ARM Limited 2010-2013. All rights reserved.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
10 static void gator_buffer_write_packed_int(int cpu, int buftype, int x)
12 uint32_t write = per_cpu(gator_buffer_write, cpu)[buftype];
13 uint32_t mask = gator_buffer_mask[buftype];
14 char *buffer = per_cpu(gator_buffer, cpu)[buftype];
18 // low order 7 bits of x
22 if ((x == 0 && (b & 0x40) == 0) || (x == -1 && (b & 0x40) != 0)) {
28 buffer[(write + packedBytes) & mask] = b;
32 per_cpu(gator_buffer_write, cpu)[buftype] = (write + packedBytes) & mask;
35 static void gator_buffer_write_packed_int64(int cpu, int buftype, long long x)
37 uint32_t write = per_cpu(gator_buffer_write, cpu)[buftype];
38 uint32_t mask = gator_buffer_mask[buftype];
39 char *buffer = per_cpu(gator_buffer, cpu)[buftype];
43 // low order 7 bits of x
47 if ((x == 0 && (b & 0x40) == 0) || (x == -1 && (b & 0x40) != 0)) {
53 buffer[(write + packedBytes) & mask] = b;
57 per_cpu(gator_buffer_write, cpu)[buftype] = (write + packedBytes) & mask;