OS_DCACHE_ROUNDUP_ADDR.3p
1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
.TH OS_DCACHE_ROUNDUP_ADDR 3P local "Silicon Graphics, Inc."
.SH NAME
.upperok
OS_DCACHE_ROUNDUP_ADDR, OS_DCACHE_ROUNDUP_SIZE \- round address, size values to a data cache line size
address to a physical address
.SH SYNOPSIS
.nf
\f3
.Op c
#include <ultra64.h>
.sp .8v
void *OS_DCACHE_ROUNDUP_ADDR(void \(**vaddr);
.sp .8v
u32 OS_DCACHE_ROUNDUP_SIZE(u32 nbytes);
.Op
\f1
.fi
.SH DESCRIPTION
.I OS_DCACHE_ROUNDUP_ADDR
is a
.IR cpp (1)
macro that rounds up an address to an alignment matching that of the
R4300 data cache line size (16 bytes).
Similarly, the
.I OS_DCACHE_ROUNDUP_SIZE
macro rounds up a integer value to the data cache line size.
.PP
These macros may be applied on a given address range given to
an agent external to the CPU
(such as the PI, SP, or DP) that
modifies physical memory directly.
If the affected memory region is not cache aligned,
there exists the possibility that a CPU program variable may also
share the data cache line.
During normal operation of the CPU cache,
the data cache line may be written back and overwrite
the data written by the external agent.
.SH SEE ALSO
.IR osPiRawStartDma (3P),
.IR osPiStartDma (3P),
.IR osSpTaskLoad (3P),
.IR osDpSetNextBuffer(3P)