Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
74bf528d
Commit
74bf528d
authored
Nov 02, 2002
by
Geert Uytterhoeven
Committed by
Linus Torvalds
Nov 02, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] Sun-3 DVMA debugging
Add Sun-3 DVMA debugging code (currently disabled, from Sam Creasey)
parent
7333261f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
78 additions
and
1 deletion
+78
-1
arch/m68k/sun3/sun3dvma.c
arch/m68k/sun3/sun3dvma.c
+78
-1
No files found.
arch/m68k/sun3/sun3dvma.c
View file @
74bf528d
...
...
@@ -14,6 +14,8 @@
#include <asm/pgtable.h>
#include <asm/dvma.h>
#undef DVMA_DEBUG
#ifdef CONFIG_SUN3X
extern
void
dvma_unmap_iommu
(
unsigned
long
baddr
,
int
len
);
#else
...
...
@@ -22,6 +24,10 @@ static inline void dvma_unmap_iommu(unsigned long a, int b)
}
#endif
#ifdef CONFIG_SUN3
extern
void
sun3_dvma_init
(
void
);
#endif
unsigned
long
iommu_use
[
IOMMU_TOTAL_ENTRIES
];
#define dvma_index(baddr) ((baddr - DVMA_START) >> DVMA_PAGE_SHIFT)
...
...
@@ -39,6 +45,60 @@ static struct list_head hole_list;
static
struct
list_head
hole_cache
;
static
struct
hole
initholes
[
64
];
#ifdef DVMA_DEBUG
static
unsigned
long
dvma_allocs
=
0
;
static
unsigned
long
dvma_frees
=
0
;
static
unsigned
long
long
dvma_alloc_bytes
=
0
;
static
unsigned
long
long
dvma_free_bytes
=
0
;
static
void
print_use
(
void
)
{
int
i
;
int
j
=
0
;
printk
(
"dvma entry usage:
\n
"
);
for
(
i
=
0
;
i
<
IOMMU_TOTAL_ENTRIES
;
i
++
)
{
if
(
!
iommu_use
[
i
])
continue
;
j
++
;
printk
(
"dvma entry: %08lx len %08lx
\n
"
,
(
i
<<
DVMA_PAGE_SHIFT
)
+
DVMA_START
,
iommu_use
[
i
]);
}
printk
(
"%d entries in use total
\n
"
,
j
);
printk
(
"allocation/free calls: %lu/%lu
\n
"
,
dvma_allocs
,
dvma_frees
);
printk
(
"allocation/free bytes: %Lx/%Lx
\n
"
,
dvma_alloc_bytes
,
dvma_free_bytes
);
}
static
void
print_holes
(
struct
list_head
*
holes
)
{
struct
list_head
*
cur
;
struct
hole
*
hole
;
printk
(
"listing dvma holes
\n
"
);
list_for_each
(
cur
,
holes
)
{
hole
=
list_entry
(
cur
,
struct
hole
,
list
);
if
((
hole
->
start
==
0
)
&&
(
hole
->
end
==
0
)
&&
(
hole
->
size
==
0
))
continue
;
printk
(
"hole: start %08lx end %08lx size %08lx
\n
"
,
hole
->
start
,
hole
->
end
,
hole
->
size
);
}
printk
(
"end of hole listing...
\n
"
);
}
#endif DVMA_DEBUG
static
inline
int
refill
(
void
)
{
...
...
@@ -93,7 +153,11 @@ static inline unsigned long get_baddr(int len, unsigned long align)
struct
hole
*
hole
;
if
(
list_empty
(
&
hole_list
))
{
printk
(
"out of dvma holes!
\n
"
);
#ifdef DVMA_DEBUG
printk
(
"out of dvma holes! (printing hole cache)
\n
"
);
print_holes
(
&
hole_cache
);
print_use
();
#endif
BUG
();
}
...
...
@@ -111,11 +175,19 @@ static inline unsigned long get_baddr(int len, unsigned long align)
hole
->
end
-=
newlen
;
hole
->
size
-=
newlen
;
dvma_entry_use
(
hole
->
end
)
=
newlen
;
#ifdef DVMA_DEBUG
dvma_allocs
++
;
dvma_alloc_bytes
+=
newlen
;
#endif
return
hole
->
end
;
}
else
if
(
hole
->
size
==
newlen
)
{
list_del
(
&
(
hole
->
list
));
list_add
(
&
(
hole
->
list
),
&
hole_cache
);
dvma_entry_use
(
hole
->
start
)
=
newlen
;
#ifdef DVMA_DEBUG
dvma_allocs
++
;
dvma_alloc_bytes
+=
newlen
;
#endif
return
hole
->
start
;
}
...
...
@@ -140,6 +212,11 @@ static inline int free_baddr(unsigned long baddr)
baddr
&=
DVMA_PAGE_MASK
;
dvma_unmap_iommu
(
baddr
,
len
);
#ifdef DVMA_DEBUG
dvma_frees
++
;
dvma_free_bytes
+=
len
;
#endif
list_for_each
(
cur
,
&
hole_list
)
{
hole
=
list_entry
(
cur
,
struct
hole
,
list
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment