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
75a00186
Commit
75a00186
authored
Oct 09, 2004
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://bk.arm.linux.org.uk/linux-2.6-pcmcia
into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents
33b01313
3c720f5b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
24 deletions
+38
-24
drivers/pcmcia/rsrc_mgr.c
drivers/pcmcia/rsrc_mgr.c
+38
-24
No files found.
drivers/pcmcia/rsrc_mgr.c
View file @
75a00186
...
...
@@ -88,6 +88,9 @@ static resource_map_t io_db = {
};
static
DECLARE_MUTEX
(
rsrc_sem
);
static
unsigned
int
rsrc_mem_probe
;
#define MEM_PROBE_LOW (1 << 0)
#define MEM_PROBE_HIGH (1 << 1)
#ifdef CONFIG_PCMCIA_PROBE
...
...
@@ -451,24 +454,22 @@ static u_long inv_probe(resource_map_t *m, struct pcmcia_socket *s)
return
do_mem_probe
(
m
->
base
,
m
->
num
,
s
);
}
static
void
validate_mem
(
struct
pcmcia_socket
*
s
)
static
void
validate_mem
(
struct
pcmcia_socket
*
s
,
unsigned
int
probe_mask
)
{
resource_map_t
*
m
,
mm
;
static
u_char
order
[]
=
{
0xd0
,
0xe0
,
0xc0
,
0xf0
};
static
int
hi
=
0
,
lo
=
0
;
u_long
b
,
i
,
ok
=
0
;
int
force_low
=
!
(
s
->
features
&
SS_CAP_PAGE_REGS
);
down
(
&
rsrc_sem
);
/* We do up to four passes through the list */
if
(
!
force_low
)
{
if
(
hi
++
||
(
inv_probe
(
mem_db
.
next
,
s
)
>
0
)
)
goto
out
;
if
(
probe_mask
&
MEM_PROBE_HIGH
)
{
if
(
inv_probe
(
mem_db
.
next
,
s
)
>
0
)
return
;
printk
(
KERN_NOTICE
"cs: warning: no high memory space "
"available!
\n
"
);
}
if
(
lo
++
)
goto
out
;
if
(
(
probe_mask
&
MEM_PROBE_LOW
)
==
0
)
return
;
for
(
m
=
mem_db
.
next
;
m
!=
&
mem_db
;
m
=
mm
.
next
)
{
mm
=
*
m
;
/* Only probe < 1 MB */
...
...
@@ -488,38 +489,51 @@ static void validate_mem(struct pcmcia_socket *s)
}
}
}
out:
up
(
&
rsrc_sem
);
}
#else
/* CONFIG_PCMCIA_PROBE */
static
void
validate_mem
(
struct
pcmcia_socket
*
s
)
static
void
validate_mem
(
struct
pcmcia_socket
*
s
,
unsigned
int
probe_mask
)
{
resource_map_t
*
m
,
mm
;
static
int
done
=
0
;
resource_map_t
*
m
,
mm
;
if
(
done
++
==
0
)
{
down
(
&
rsrc_sem
);
for
(
m
=
mem_db
.
next
;
m
!=
&
mem_db
;
m
=
mm
.
next
)
{
mm
=
*
m
;
if
(
do_mem_probe
(
mm
.
base
,
mm
.
num
,
s
))
break
;
mm
=
*
m
;
if
(
do_mem_probe
(
mm
.
base
,
mm
.
num
,
s
))
break
;
}
up
(
&
rsrc_sem
);
}
}
#endif
/* CONFIG_PCMCIA_PROBE */
/*
* Locking note: this is the only place where we take
* both rsrc_sem and skt_sem.
*/
void
pcmcia_validate_mem
(
struct
pcmcia_socket
*
s
)
{
down
(
&
s
->
skt_sem
);
if
(
probe_mem
)
{
unsigned
int
probe_mask
;
down
(
&
rsrc_sem
);
probe_mask
=
MEM_PROBE_LOW
;
if
(
s
->
features
&
SS_CAP_PAGE_REGS
)
probe_mask
=
MEM_PROBE_HIGH
;
if
(
probe_mask
&
~
rsrc_mem_probe
)
{
rsrc_mem_probe
|=
probe_mask
;
if
(
probe_mem
&&
s
->
state
&
SOCKET_PRESENT
)
validate_mem
(
s
);
down
(
&
s
->
skt_sem
);
up
(
&
s
->
skt_sem
);
if
(
s
->
state
&
SOCKET_PRESENT
)
validate_mem
(
s
,
probe_mask
);
up
(
&
s
->
skt_sem
);
}
up
(
&
rsrc_sem
);
}
}
EXPORT_SYMBOL
(
pcmcia_validate_mem
);
...
...
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