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
51491305
Commit
51491305
authored
Jun 11, 2003
by
Alexander Viro
Committed by
Linus Torvalds
Jun 11, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] tty_driver refcounting
arch/um/drivers/* converted to dynamic allocation
parent
bb6b371b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
18 deletions
+25
-18
arch/um/drivers/line.c
arch/um/drivers/line.c
+9
-5
arch/um/drivers/ssl.c
arch/um/drivers/ssl.c
+6
-5
arch/um/drivers/stdio_console.c
arch/um/drivers/stdio_console.c
+7
-6
arch/um/include/line.h
arch/um/include/line.h
+3
-2
No files found.
arch/um/drivers/line.c
View file @
51491305
...
@@ -399,12 +399,17 @@ int line_remove(struct line *lines, int num, char *str)
...
@@ -399,12 +399,17 @@ int line_remove(struct line *lines, int num, char *str)
return
(
line_setup
(
lines
,
num
,
config
,
0
));
return
(
line_setup
(
lines
,
num
,
config
,
0
));
}
}
void
line_register_devfs
(
struct
lines
*
set
,
struct
line_driver
*
line_driver
,
struct
tty_driver
*
line_register_devfs
(
struct
lines
*
set
,
struct
tty_driver
*
driver
,
struct
line
*
lines
,
struct
line_driver
*
line_driver
,
struct
tty_operations
*
ops
,
struct
line
*
lines
,
int
nlines
)
int
nlines
)
{
{
int
err
,
i
;
int
err
,
i
;
char
*
from
,
*
to
;
char
*
from
,
*
to
;
struct
tty_driver
*
driver
=
alloc_tty_driver
(
nlines
);
if
(
!
driver
)
return
NULL
;
driver
->
driver_name
=
line_driver
->
name
;
driver
->
driver_name
=
line_driver
->
name
;
driver
->
name
=
line_driver
->
devfs_name
;
driver
->
name
=
line_driver
->
devfs_name
;
...
@@ -412,11 +417,9 @@ void line_register_devfs(struct lines *set, struct line_driver *line_driver,
...
@@ -412,11 +417,9 @@ void line_register_devfs(struct lines *set, struct line_driver *line_driver,
driver
->
minor_start
=
line_driver
->
minor_start
;
driver
->
minor_start
=
line_driver
->
minor_start
;
driver
->
type
=
line_driver
->
type
;
driver
->
type
=
line_driver
->
type
;
driver
->
subtype
=
line_driver
->
subtype
;
driver
->
subtype
=
line_driver
->
subtype
;
driver
->
magic
=
TTY_DRIVER_MAGIC
;
driver
->
flags
=
TTY_DRIVER_REAL_RAW
;
driver
->
flags
=
TTY_DRIVER_REAL_RAW
;
driver
->
num
=
set
->
num
;
driver
->
write_room
=
line_write_room
;
driver
->
init_termios
=
tty_std_termios
;
driver
->
init_termios
=
tty_std_termios
;
tty_set_operations
(
driver
,
ops
);
if
(
tty_register_driver
(
driver
))
if
(
tty_register_driver
(
driver
))
panic
(
"line_register_devfs : Couldn't register driver
\n
"
);
panic
(
"line_register_devfs : Couldn't register driver
\n
"
);
...
@@ -433,6 +436,7 @@ void line_register_devfs(struct lines *set, struct line_driver *line_driver,
...
@@ -433,6 +436,7 @@ void line_register_devfs(struct lines *set, struct line_driver *line_driver,
}
}
mconsole_register_dev
(
&
line_driver
->
mc
);
mconsole_register_dev
(
&
line_driver
->
mc
);
return
driver
;
}
}
void
lines_init
(
struct
line
*
lines
,
int
nlines
)
void
lines_init
(
struct
line
*
lines
,
int
nlines
)
...
...
arch/um/drivers/ssl.c
View file @
51491305
...
@@ -29,7 +29,7 @@ static int ssl_version = 1;
...
@@ -29,7 +29,7 @@ static int ssl_version = 1;
* by the tty driver.
* by the tty driver.
*/
*/
static
struct
tty_driver
ssl_driver
;
static
struct
tty_driver
*
ssl_driver
;
#define NR_PORTS 64
#define NR_PORTS 64
...
@@ -189,7 +189,7 @@ void ssl_hangup(struct tty_struct *tty)
...
@@ -189,7 +189,7 @@ void ssl_hangup(struct tty_struct *tty)
{
{
}
}
static
struct
tty_
driver
ssl_driver
=
{
static
struct
tty_
operations
ssl_ops
=
{
.
open
=
ssl_open
,
.
open
=
ssl_open
,
.
close
=
ssl_close
,
.
close
=
ssl_close
,
.
write
=
ssl_write
,
.
write
=
ssl_write
,
...
@@ -203,7 +203,8 @@ static struct tty_driver ssl_driver = {
...
@@ -203,7 +203,8 @@ static struct tty_driver ssl_driver = {
.
set_termios
=
ssl_set_termios
,
.
set_termios
=
ssl_set_termios
,
.
stop
=
ssl_stop
,
.
stop
=
ssl_stop
,
.
start
=
ssl_start
,
.
start
=
ssl_start
,
.
hangup
=
ssl_hangup
.
hangup
=
ssl_hangup
,
.
write_room
=
line_write_room
,
};
};
/* Changed by ssl_init and referenced by ssl_exit, which are both serialized
/* Changed by ssl_init and referenced by ssl_exit, which are both serialized
...
@@ -218,8 +219,8 @@ int ssl_init(void)
...
@@ -218,8 +219,8 @@ int ssl_init(void)
printk
(
KERN_INFO
"Initializing software serial port version %d
\n
"
,
printk
(
KERN_INFO
"Initializing software serial port version %d
\n
"
,
ssl_version
);
ssl_version
);
line_register_devfs
(
&
lines
,
&
driver
,
&
ssl_driver
,
serial_lines
,
ssl_driver
=
line_register_devfs
(
&
lines
,
&
driver
,
&
ssl_ops
,
sizeof
(
serial_lines
)
/
sizeof
(
serial_lines
[
0
]));
serial_lines
,
sizeof
(
serial_lines
)
/
sizeof
(
serial_lines
[
0
]));
lines_init
(
serial_lines
,
sizeof
(
serial_lines
)
/
sizeof
(
serial_lines
[
0
]));
lines_init
(
serial_lines
,
sizeof
(
serial_lines
)
/
sizeof
(
serial_lines
[
0
]));
...
...
arch/um/drivers/stdio_console.c
View file @
51491305
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
* by the tty driver.
* by the tty driver.
*/
*/
static
struct
tty_driver
console_driver
;
static
struct
tty_driver
*
console_driver
;
static
struct
chan_ops
init_console_ops
=
{
static
struct
chan_ops
init_console_ops
=
{
.
type
=
"you shouldn't see this"
,
.
type
=
"you shouldn't see this"
,
...
@@ -165,8 +165,8 @@ int stdio_init(void)
...
@@ -165,8 +165,8 @@ int stdio_init(void)
printk
(
KERN_INFO
"Initializing stdio console driver
\n
"
);
printk
(
KERN_INFO
"Initializing stdio console driver
\n
"
);
line_register_devfs
(
&
console_lines
,
&
driver
,
&
console_driver
,
vts
,
console_driver
=
line_register_devfs
(
&
console_lines
,
&
driver
,
sizeof
(
vts
)
/
sizeof
(
vts
[
0
]));
&
console_ops
,
vts
,
sizeof
(
vts
)
/
sizeof
(
vts
[
0
]));
lines_init
(
vts
,
sizeof
(
vts
)
/
sizeof
(
vts
[
0
]));
lines_init
(
vts
,
sizeof
(
vts
)
/
sizeof
(
vts
[
0
]));
...
@@ -188,18 +188,19 @@ static void console_write(struct console *console, const char *string,
...
@@ -188,18 +188,19 @@ static void console_write(struct console *console, const char *string,
if
(
con_init_done
)
up
(
&
vts
[
console
->
index
].
sem
);
if
(
con_init_done
)
up
(
&
vts
[
console
->
index
].
sem
);
}
}
static
struct
tty_
driver
console_driver
=
{
static
struct
tty_
operations
console_ops
=
{
.
open
=
con_open
,
.
open
=
con_open
,
.
close
=
con_close
,
.
close
=
con_close
,
.
write
=
con_write
,
.
write
=
con_write
,
.
chars_in_buffer
=
chars_in_buffer
,
.
chars_in_buffer
=
chars_in_buffer
,
.
set_termios
=
set_termios
.
set_termios
=
set_termios
,
.
write_room
=
line_write_room
,
};
};
static
struct
tty_driver
*
console_device
(
struct
console
*
c
,
int
*
index
)
static
struct
tty_driver
*
console_device
(
struct
console
*
c
,
int
*
index
)
{
{
*
index
=
c
->
index
;
*
index
=
c
->
index
;
return
&
console_driver
;
return
console_driver
;
}
}
static
int
console_setup
(
struct
console
*
co
,
char
*
options
)
static
int
console_setup
(
struct
console
*
co
,
char
*
options
)
...
...
arch/um/include/line.h
View file @
51491305
...
@@ -81,9 +81,10 @@ extern char *add_xterm_umid(char *base);
...
@@ -81,9 +81,10 @@ extern char *add_xterm_umid(char *base);
extern
int
line_setup_irq
(
int
fd
,
int
input
,
int
output
,
void
*
data
);
extern
int
line_setup_irq
(
int
fd
,
int
input
,
int
output
,
void
*
data
);
extern
void
line_close_chan
(
struct
line
*
line
);
extern
void
line_close_chan
(
struct
line
*
line
);
extern
void
line_disable
(
struct
line
*
line
,
int
current_irq
);
extern
void
line_disable
(
struct
line
*
line
,
int
current_irq
);
extern
void
line_register_devfs
(
struct
lines
*
set
,
extern
struct
tty_driver
*
line_register_devfs
(
struct
lines
*
set
,
struct
line_driver
*
line_driver
,
struct
line_driver
*
line_driver
,
struct
tty_driver
*
driver
,
struct
line
*
lines
,
struct
tty_operations
*
driver
,
struct
line
*
lines
,
int
nlines
);
int
nlines
);
extern
void
lines_init
(
struct
line
*
lines
,
int
nlines
);
extern
void
lines_init
(
struct
line
*
lines
,
int
nlines
);
extern
void
close_lines
(
struct
line
*
lines
,
int
nlines
);
extern
void
close_lines
(
struct
line
*
lines
,
int
nlines
);
...
...
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