-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathcache.c
More file actions
50 lines (40 loc) · 904 Bytes
/
Copy pathcache.c
File metadata and controls
50 lines (40 loc) · 904 Bytes
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
43
44
45
46
47
48
49
/*
* Low level cache control functions.
*
* Copyright (C) 2009 - 2010 B Labs Ltd.
*
* Author: Bahadir Balban
*/
#include <l4/lib/printk.h>
#include <l4/api/errno.h>
#include <l4/generic/tcb.h>
#include <l4/api/cache.h>
#include <l4/generic/capability.h>
#include INC_GLUE(cache.h)
int sys_cache_control(unsigned long start, unsigned long end,
unsigned int flags)
{
int ret = 0;
if ((ret = cap_cache_check(start, end, flags)) < 0)
return ret;
switch (flags) {
case L4_INVALIDATE_ICACHE:
arch_invalidate_icache(start, end);
break;
case L4_INVALIDATE_DCACHE:
arch_invalidate_dcache(start, end);
break;
case L4_CLEAN_DCACHE:
arch_clean_dcache(start, end);
break;
case L4_CLEAN_INVALIDATE_DCACHE:
arch_clean_invalidate_dcache(start, end);
break;
case L4_INVALIDATE_TLB:
arch_invalidate_tlb(start, end);
break;
default:
ret = -EINVAL;
}
return ret;
}