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
bd4b19c1
Commit
bd4b19c1
authored
Sep 24, 2003
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DRI CVS merge: add DRM(calloc)() function, and remove unnecessary TLB
flush after vmap.
parent
ab4a802e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
3 deletions
+24
-3
drivers/char/drm/drmP.h
drivers/char/drm/drmP.h
+1
-0
drivers/char/drm/drm_memory.h
drivers/char/drm/drm_memory.h
+12
-3
drivers/char/drm/drm_memory_debug.h
drivers/char/drm/drm_memory_debug.h
+11
-0
No files found.
drivers/char/drm/drmP.h
View file @
bd4b19c1
...
...
@@ -784,6 +784,7 @@ extern void DRM(mem_init)(void);
extern
int
DRM
(
mem_info
)(
char
*
buf
,
char
**
start
,
off_t
offset
,
int
request
,
int
*
eof
,
void
*
data
);
extern
void
*
DRM
(
alloc
)(
size_t
size
,
int
area
);
extern
void
*
DRM
(
calloc
)(
size_t
nmemb
,
size_t
size
,
int
area
);
extern
void
*
DRM
(
realloc
)(
void
*
oldpt
,
size_t
oldsize
,
size_t
size
,
int
area
);
extern
void
DRM
(
free
)(
void
*
pt
,
size_t
size
,
int
area
);
...
...
drivers/char/drm/drm_memory.h
View file @
bd4b19c1
...
...
@@ -117,10 +117,7 @@ agp_remap (unsigned long offset, unsigned long size, drm_device_t *dev)
page_map
[
i
]
=
pfn_to_page
(
phys_addr_map
[
i
]
>>
PAGE_SHIFT
);
addr
=
vmap
(
page_map
,
num_pages
,
VM_IOREMAP
,
PAGE_AGP
);
vfree
(
page_map
);
if
(
!
addr
)
return
NULL
;
flush_tlb_kernel_range
((
unsigned
long
)
addr
,
(
unsigned
long
)
addr
+
size
);
return
addr
;
}
...
...
@@ -224,6 +221,18 @@ void *DRM(alloc)(size_t size, int area)
return
kmalloc
(
size
,
GFP_KERNEL
);
}
/** Wrapper around kmalloc() */
void
*
DRM
(
calloc
)(
size_t
size
,
size_t
nmemb
,
int
area
)
{
void
*
addr
;
addr
=
kmalloc
(
size
*
nmemb
,
GFP_KERNEL
);
if
(
addr
!=
NULL
)
memset
((
void
*
)
addr
,
0
,
size
*
nmemb
);
return
addr
;
}
/** Wrapper around kmalloc() and kfree() */
void
*
DRM
(
realloc
)(
void
*
oldpt
,
size_t
oldsize
,
size_t
size
,
int
area
)
{
...
...
drivers/char/drm/drm_memory_debug.h
View file @
bd4b19c1
...
...
@@ -166,6 +166,17 @@ void *DRM(alloc)(size_t size, int area)
return
pt
;
}
void
*
DRM
(
calloc
)(
size_t
size
,
size_t
nmemb
,
int
area
)
{
void
*
addr
;
addr
=
DRM
(
alloc
)(
nmemb
*
size
,
area
);
if
(
addr
!=
NULL
)
memset
((
void
*
)
addr
,
0
,
size
*
nmemb
);
return
addr
;
}
void
*
DRM
(
realloc
)(
void
*
oldpt
,
size_t
oldsize
,
size_t
size
,
int
area
)
{
void
*
pt
;
...
...
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