diff options
Diffstat (limited to 'drivers/tty/vt/vt.c')
-rw-r--r-- | drivers/tty/vt/vt.c | 124 |
1 files changed, 62 insertions, 62 deletions
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index 76407eca9ab0..b230bd3f056f 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c | |||
@@ -1003,9 +1003,9 @@ static int vt_resize(struct tty_struct *tty, struct winsize *ws) | |||
1003 | struct vc_data *vc = tty->driver_data; | 1003 | struct vc_data *vc = tty->driver_data; |
1004 | int ret; | 1004 | int ret; |
1005 | 1005 | ||
1006 | acquire_console_sem(); | 1006 | console_lock(); |
1007 | ret = vc_do_resize(tty, vc, ws->ws_col, ws->ws_row); | 1007 | ret = vc_do_resize(tty, vc, ws->ws_col, ws->ws_row); |
1008 | release_console_sem(); | 1008 | console_unlock(); |
1009 | return ret; | 1009 | return ret; |
1010 | } | 1010 | } |
1011 | 1011 | ||
@@ -1271,7 +1271,7 @@ static void default_attr(struct vc_data *vc) | |||
1271 | vc->vc_color = vc->vc_def_color; | 1271 | vc->vc_color = vc->vc_def_color; |
1272 | } | 1272 | } |
1273 | 1273 | ||
1274 | /* console_sem is held */ | 1274 | /* console_lock is held */ |
1275 | static void csi_m(struct vc_data *vc) | 1275 | static void csi_m(struct vc_data *vc) |
1276 | { | 1276 | { |
1277 | int i; | 1277 | int i; |
@@ -1415,7 +1415,7 @@ int mouse_reporting(void) | |||
1415 | return vc_cons[fg_console].d->vc_report_mouse; | 1415 | return vc_cons[fg_console].d->vc_report_mouse; |
1416 | } | 1416 | } |
1417 | 1417 | ||
1418 | /* console_sem is held */ | 1418 | /* console_lock is held */ |
1419 | static void set_mode(struct vc_data *vc, int on_off) | 1419 | static void set_mode(struct vc_data *vc, int on_off) |
1420 | { | 1420 | { |
1421 | int i; | 1421 | int i; |
@@ -1485,7 +1485,7 @@ static void set_mode(struct vc_data *vc, int on_off) | |||
1485 | } | 1485 | } |
1486 | } | 1486 | } |
1487 | 1487 | ||
1488 | /* console_sem is held */ | 1488 | /* console_lock is held */ |
1489 | static void setterm_command(struct vc_data *vc) | 1489 | static void setterm_command(struct vc_data *vc) |
1490 | { | 1490 | { |
1491 | switch(vc->vc_par[0]) { | 1491 | switch(vc->vc_par[0]) { |
@@ -1545,7 +1545,7 @@ static void setterm_command(struct vc_data *vc) | |||
1545 | } | 1545 | } |
1546 | } | 1546 | } |
1547 | 1547 | ||
1548 | /* console_sem is held */ | 1548 | /* console_lock is held */ |
1549 | static void csi_at(struct vc_data *vc, unsigned int nr) | 1549 | static void csi_at(struct vc_data *vc, unsigned int nr) |
1550 | { | 1550 | { |
1551 | if (nr > vc->vc_cols - vc->vc_x) | 1551 | if (nr > vc->vc_cols - vc->vc_x) |
@@ -1555,7 +1555,7 @@ static void csi_at(struct vc_data *vc, unsigned int nr) | |||
1555 | insert_char(vc, nr); | 1555 | insert_char(vc, nr); |
1556 | } | 1556 | } |
1557 | 1557 | ||
1558 | /* console_sem is held */ | 1558 | /* console_lock is held */ |
1559 | static void csi_L(struct vc_data *vc, unsigned int nr) | 1559 | static void csi_L(struct vc_data *vc, unsigned int nr) |
1560 | { | 1560 | { |
1561 | if (nr > vc->vc_rows - vc->vc_y) | 1561 | if (nr > vc->vc_rows - vc->vc_y) |
@@ -1566,7 +1566,7 @@ static void csi_L(struct vc_data *vc, unsigned int nr) | |||
1566 | vc->vc_need_wrap = 0; | 1566 | vc->vc_need_wrap = 0; |
1567 | } | 1567 | } |
1568 | 1568 | ||
1569 | /* console_sem is held */ | 1569 | /* console_lock is held */ |
1570 | static void csi_P(struct vc_data *vc, unsigned int nr) | 1570 | static void csi_P(struct vc_data *vc, unsigned int nr) |
1571 | { | 1571 | { |
1572 | if (nr > vc->vc_cols - vc->vc_x) | 1572 | if (nr > vc->vc_cols - vc->vc_x) |
@@ -1576,7 +1576,7 @@ static void csi_P(struct vc_data *vc, unsigned int nr) | |||
1576 | delete_char(vc, nr); | 1576 | delete_char(vc, nr); |
1577 | } | 1577 | } |
1578 | 1578 | ||
1579 | /* console_sem is held */ | 1579 | /* console_lock is held */ |
1580 | static void csi_M(struct vc_data *vc, unsigned int nr) | 1580 | static void csi_M(struct vc_data *vc, unsigned int nr) |
1581 | { | 1581 | { |
1582 | if (nr > vc->vc_rows - vc->vc_y) | 1582 | if (nr > vc->vc_rows - vc->vc_y) |
@@ -1587,7 +1587,7 @@ static void csi_M(struct vc_data *vc, unsigned int nr) | |||
1587 | vc->vc_need_wrap = 0; | 1587 | vc->vc_need_wrap = 0; |
1588 | } | 1588 | } |
1589 | 1589 | ||
1590 | /* console_sem is held (except via vc_init->reset_terminal */ | 1590 | /* console_lock is held (except via vc_init->reset_terminal */ |
1591 | static void save_cur(struct vc_data *vc) | 1591 | static void save_cur(struct vc_data *vc) |
1592 | { | 1592 | { |
1593 | vc->vc_saved_x = vc->vc_x; | 1593 | vc->vc_saved_x = vc->vc_x; |
@@ -1603,7 +1603,7 @@ static void save_cur(struct vc_data *vc) | |||
1603 | vc->vc_saved_G1 = vc->vc_G1_charset; | 1603 | vc->vc_saved_G1 = vc->vc_G1_charset; |
1604 | } | 1604 | } |
1605 | 1605 | ||
1606 | /* console_sem is held */ | 1606 | /* console_lock is held */ |
1607 | static void restore_cur(struct vc_data *vc) | 1607 | static void restore_cur(struct vc_data *vc) |
1608 | { | 1608 | { |
1609 | gotoxy(vc, vc->vc_saved_x, vc->vc_saved_y); | 1609 | gotoxy(vc, vc->vc_saved_x, vc->vc_saved_y); |
@@ -1625,7 +1625,7 @@ enum { ESnormal, ESesc, ESsquare, ESgetpars, ESgotpars, ESfunckey, | |||
1625 | EShash, ESsetG0, ESsetG1, ESpercent, ESignore, ESnonstd, | 1625 | EShash, ESsetG0, ESsetG1, ESpercent, ESignore, ESnonstd, |
1626 | ESpalette }; | 1626 | ESpalette }; |
1627 | 1627 | ||
1628 | /* console_sem is held (except via vc_init()) */ | 1628 | /* console_lock is held (except via vc_init()) */ |
1629 | static void reset_terminal(struct vc_data *vc, int do_clear) | 1629 | static void reset_terminal(struct vc_data *vc, int do_clear) |
1630 | { | 1630 | { |
1631 | vc->vc_top = 0; | 1631 | vc->vc_top = 0; |
@@ -1685,7 +1685,7 @@ static void reset_terminal(struct vc_data *vc, int do_clear) | |||
1685 | csi_J(vc, 2); | 1685 | csi_J(vc, 2); |
1686 | } | 1686 | } |
1687 | 1687 | ||
1688 | /* console_sem is held */ | 1688 | /* console_lock is held */ |
1689 | static void do_con_trol(struct tty_struct *tty, struct vc_data *vc, int c) | 1689 | static void do_con_trol(struct tty_struct *tty, struct vc_data *vc, int c) |
1690 | { | 1690 | { |
1691 | /* | 1691 | /* |
@@ -2119,7 +2119,7 @@ static int is_double_width(uint32_t ucs) | |||
2119 | return bisearch(ucs, double_width, ARRAY_SIZE(double_width) - 1); | 2119 | return bisearch(ucs, double_width, ARRAY_SIZE(double_width) - 1); |
2120 | } | 2120 | } |
2121 | 2121 | ||
2122 | /* acquires console_sem */ | 2122 | /* acquires console_lock */ |
2123 | static int do_con_write(struct tty_struct *tty, const unsigned char *buf, int count) | 2123 | static int do_con_write(struct tty_struct *tty, const unsigned char *buf, int count) |
2124 | { | 2124 | { |
2125 | #ifdef VT_BUF_VRAM_ONLY | 2125 | #ifdef VT_BUF_VRAM_ONLY |
@@ -2147,11 +2147,11 @@ static int do_con_write(struct tty_struct *tty, const unsigned char *buf, int co | |||
2147 | 2147 | ||
2148 | might_sleep(); | 2148 | might_sleep(); |
2149 | 2149 | ||
2150 | acquire_console_sem(); | 2150 | console_lock(); |
2151 | vc = tty->driver_data; | 2151 | vc = tty->driver_data; |
2152 | if (vc == NULL) { | 2152 | if (vc == NULL) { |
2153 | printk(KERN_ERR "vt: argh, driver_data is NULL !\n"); | 2153 | printk(KERN_ERR "vt: argh, driver_data is NULL !\n"); |
2154 | release_console_sem(); | 2154 | console_unlock(); |
2155 | return 0; | 2155 | return 0; |
2156 | } | 2156 | } |
2157 | 2157 | ||
@@ -2159,7 +2159,7 @@ static int do_con_write(struct tty_struct *tty, const unsigned char *buf, int co | |||
2159 | if (!vc_cons_allocated(currcons)) { | 2159 | if (!vc_cons_allocated(currcons)) { |
2160 | /* could this happen? */ | 2160 | /* could this happen? */ |
2161 | printk_once("con_write: tty %d not allocated\n", currcons+1); | 2161 | printk_once("con_write: tty %d not allocated\n", currcons+1); |
2162 | release_console_sem(); | 2162 | console_unlock(); |
2163 | return 0; | 2163 | return 0; |
2164 | } | 2164 | } |
2165 | 2165 | ||
@@ -2375,7 +2375,7 @@ rescan_last_byte: | |||
2375 | } | 2375 | } |
2376 | FLUSH | 2376 | FLUSH |
2377 | console_conditional_schedule(); | 2377 | console_conditional_schedule(); |
2378 | release_console_sem(); | 2378 | console_unlock(); |
2379 | notify_update(vc); | 2379 | notify_update(vc); |
2380 | return n; | 2380 | return n; |
2381 | #undef FLUSH | 2381 | #undef FLUSH |
@@ -2388,11 +2388,11 @@ rescan_last_byte: | |||
2388 | * us to do the switches asynchronously (needed when we want | 2388 | * us to do the switches asynchronously (needed when we want |
2389 | * to switch due to a keyboard interrupt). Synchronization | 2389 | * to switch due to a keyboard interrupt). Synchronization |
2390 | * with other console code and prevention of re-entrancy is | 2390 | * with other console code and prevention of re-entrancy is |
2391 | * ensured with console_sem. | 2391 | * ensured with console_lock. |
2392 | */ | 2392 | */ |
2393 | static void console_callback(struct work_struct *ignored) | 2393 | static void console_callback(struct work_struct *ignored) |
2394 | { | 2394 | { |
2395 | acquire_console_sem(); | 2395 | console_lock(); |
2396 | 2396 | ||
2397 | if (want_console >= 0) { | 2397 | if (want_console >= 0) { |
2398 | if (want_console != fg_console && | 2398 | if (want_console != fg_console && |
@@ -2422,7 +2422,7 @@ static void console_callback(struct work_struct *ignored) | |||
2422 | } | 2422 | } |
2423 | notify_update(vc_cons[fg_console].d); | 2423 | notify_update(vc_cons[fg_console].d); |
2424 | 2424 | ||
2425 | release_console_sem(); | 2425 | console_unlock(); |
2426 | } | 2426 | } |
2427 | 2427 | ||
2428 | int set_console(int nr) | 2428 | int set_console(int nr) |
@@ -2603,7 +2603,7 @@ static struct console vt_console_driver = { | |||
2603 | */ | 2603 | */ |
2604 | 2604 | ||
2605 | /* | 2605 | /* |
2606 | * Generally a bit racy with respect to console_sem(). | 2606 | * Generally a bit racy with respect to console_lock();. |
2607 | * | 2607 | * |
2608 | * There are some functions which don't need it. | 2608 | * There are some functions which don't need it. |
2609 | * | 2609 | * |
@@ -2629,17 +2629,17 @@ int tioclinux(struct tty_struct *tty, unsigned long arg) | |||
2629 | switch (type) | 2629 | switch (type) |
2630 | { | 2630 | { |
2631 | case TIOCL_SETSEL: | 2631 | case TIOCL_SETSEL: |
2632 | acquire_console_sem(); | 2632 | console_lock(); |
2633 | ret = set_selection((struct tiocl_selection __user *)(p+1), tty); | 2633 | ret = set_selection((struct tiocl_selection __user *)(p+1), tty); |
2634 | release_console_sem(); | 2634 | console_unlock(); |
2635 | break; | 2635 | break; |
2636 | case TIOCL_PASTESEL: | 2636 | case TIOCL_PASTESEL: |
2637 | ret = paste_selection(tty); | 2637 | ret = paste_selection(tty); |
2638 | break; | 2638 | break; |
2639 | case TIOCL_UNBLANKSCREEN: | 2639 | case TIOCL_UNBLANKSCREEN: |
2640 | acquire_console_sem(); | 2640 | console_lock(); |
2641 | unblank_screen(); | 2641 | unblank_screen(); |
2642 | release_console_sem(); | 2642 | console_unlock(); |
2643 | break; | 2643 | break; |
2644 | case TIOCL_SELLOADLUT: | 2644 | case TIOCL_SELLOADLUT: |
2645 | ret = sel_loadlut(p); | 2645 | ret = sel_loadlut(p); |
@@ -2688,10 +2688,10 @@ int tioclinux(struct tty_struct *tty, unsigned long arg) | |||
2688 | } | 2688 | } |
2689 | break; | 2689 | break; |
2690 | case TIOCL_BLANKSCREEN: /* until explicitly unblanked, not only poked */ | 2690 | case TIOCL_BLANKSCREEN: /* until explicitly unblanked, not only poked */ |
2691 | acquire_console_sem(); | 2691 | console_lock(); |
2692 | ignore_poke = 1; | 2692 | ignore_poke = 1; |
2693 | do_blank_screen(0); | 2693 | do_blank_screen(0); |
2694 | release_console_sem(); | 2694 | console_unlock(); |
2695 | break; | 2695 | break; |
2696 | case TIOCL_BLANKEDSCREEN: | 2696 | case TIOCL_BLANKEDSCREEN: |
2697 | ret = console_blanked; | 2697 | ret = console_blanked; |
@@ -2790,11 +2790,11 @@ static void con_flush_chars(struct tty_struct *tty) | |||
2790 | return; | 2790 | return; |
2791 | 2791 | ||
2792 | /* if we race with con_close(), vt may be null */ | 2792 | /* if we race with con_close(), vt may be null */ |
2793 | acquire_console_sem(); | 2793 | console_lock(); |
2794 | vc = tty->driver_data; | 2794 | vc = tty->driver_data; |
2795 | if (vc) | 2795 | if (vc) |
2796 | set_cursor(vc); | 2796 | set_cursor(vc); |
2797 | release_console_sem(); | 2797 | console_unlock(); |
2798 | } | 2798 | } |
2799 | 2799 | ||
2800 | /* | 2800 | /* |
@@ -2805,7 +2805,7 @@ static int con_open(struct tty_struct *tty, struct file *filp) | |||
2805 | unsigned int currcons = tty->index; | 2805 | unsigned int currcons = tty->index; |
2806 | int ret = 0; | 2806 | int ret = 0; |
2807 | 2807 | ||
2808 | acquire_console_sem(); | 2808 | console_lock(); |
2809 | if (tty->driver_data == NULL) { | 2809 | if (tty->driver_data == NULL) { |
2810 | ret = vc_allocate(currcons); | 2810 | ret = vc_allocate(currcons); |
2811 | if (ret == 0) { | 2811 | if (ret == 0) { |
@@ -2813,7 +2813,7 @@ static int con_open(struct tty_struct *tty, struct file *filp) | |||
2813 | 2813 | ||
2814 | /* Still being freed */ | 2814 | /* Still being freed */ |
2815 | if (vc->port.tty) { | 2815 | if (vc->port.tty) { |
2816 | release_console_sem(); | 2816 | console_unlock(); |
2817 | return -ERESTARTSYS; | 2817 | return -ERESTARTSYS; |
2818 | } | 2818 | } |
2819 | tty->driver_data = vc; | 2819 | tty->driver_data = vc; |
@@ -2827,11 +2827,11 @@ static int con_open(struct tty_struct *tty, struct file *filp) | |||
2827 | tty->termios->c_iflag |= IUTF8; | 2827 | tty->termios->c_iflag |= IUTF8; |
2828 | else | 2828 | else |
2829 | tty->termios->c_iflag &= ~IUTF8; | 2829 | tty->termios->c_iflag &= ~IUTF8; |
2830 | release_console_sem(); | 2830 | console_unlock(); |
2831 | return ret; | 2831 | return ret; |
2832 | } | 2832 | } |
2833 | } | 2833 | } |
2834 | release_console_sem(); | 2834 | console_unlock(); |
2835 | return ret; | 2835 | return ret; |
2836 | } | 2836 | } |
2837 | 2837 | ||
@@ -2844,9 +2844,9 @@ static void con_shutdown(struct tty_struct *tty) | |||
2844 | { | 2844 | { |
2845 | struct vc_data *vc = tty->driver_data; | 2845 | struct vc_data *vc = tty->driver_data; |
2846 | BUG_ON(vc == NULL); | 2846 | BUG_ON(vc == NULL); |
2847 | acquire_console_sem(); | 2847 | console_lock(); |
2848 | vc->port.tty = NULL; | 2848 | vc->port.tty = NULL; |
2849 | release_console_sem(); | 2849 | console_unlock(); |
2850 | tty_shutdown(tty); | 2850 | tty_shutdown(tty); |
2851 | } | 2851 | } |
2852 | 2852 | ||
@@ -2893,13 +2893,13 @@ static int __init con_init(void) | |||
2893 | struct vc_data *vc; | 2893 | struct vc_data *vc; |
2894 | unsigned int currcons = 0, i; | 2894 | unsigned int currcons = 0, i; |
2895 | 2895 | ||
2896 | acquire_console_sem(); | 2896 | console_lock(); |
2897 | 2897 | ||
2898 | if (conswitchp) | 2898 | if (conswitchp) |
2899 | display_desc = conswitchp->con_startup(); | 2899 | display_desc = conswitchp->con_startup(); |
2900 | if (!display_desc) { | 2900 | if (!display_desc) { |
2901 | fg_console = 0; | 2901 | fg_console = 0; |
2902 | release_console_sem(); | 2902 | console_unlock(); |
2903 | return 0; | 2903 | return 0; |
2904 | } | 2904 | } |
2905 | 2905 | ||
@@ -2946,7 +2946,7 @@ static int __init con_init(void) | |||
2946 | printable = 1; | 2946 | printable = 1; |
2947 | printk("\n"); | 2947 | printk("\n"); |
2948 | 2948 | ||
2949 | release_console_sem(); | 2949 | console_unlock(); |
2950 | 2950 | ||
2951 | #ifdef CONFIG_VT_CONSOLE | 2951 | #ifdef CONFIG_VT_CONSOLE |
2952 | register_console(&vt_console_driver); | 2952 | register_console(&vt_console_driver); |
@@ -3037,7 +3037,7 @@ static int bind_con_driver(const struct consw *csw, int first, int last, | |||
3037 | if (!try_module_get(owner)) | 3037 | if (!try_module_get(owner)) |
3038 | return -ENODEV; | 3038 | return -ENODEV; |
3039 | 3039 | ||
3040 | acquire_console_sem(); | 3040 | console_lock(); |
3041 | 3041 | ||
3042 | /* check if driver is registered */ | 3042 | /* check if driver is registered */ |
3043 | for (i = 0; i < MAX_NR_CON_DRIVER; i++) { | 3043 | for (i = 0; i < MAX_NR_CON_DRIVER; i++) { |
@@ -3122,7 +3122,7 @@ static int bind_con_driver(const struct consw *csw, int first, int last, | |||
3122 | 3122 | ||
3123 | retval = 0; | 3123 | retval = 0; |
3124 | err: | 3124 | err: |
3125 | release_console_sem(); | 3125 | console_unlock(); |
3126 | module_put(owner); | 3126 | module_put(owner); |
3127 | return retval; | 3127 | return retval; |
3128 | }; | 3128 | }; |
@@ -3171,7 +3171,7 @@ int unbind_con_driver(const struct consw *csw, int first, int last, int deflt) | |||
3171 | if (!try_module_get(owner)) | 3171 | if (!try_module_get(owner)) |
3172 | return -ENODEV; | 3172 | return -ENODEV; |
3173 | 3173 | ||
3174 | acquire_console_sem(); | 3174 | console_lock(); |
3175 | 3175 | ||
3176 | /* check if driver is registered and if it is unbindable */ | 3176 | /* check if driver is registered and if it is unbindable */ |
3177 | for (i = 0; i < MAX_NR_CON_DRIVER; i++) { | 3177 | for (i = 0; i < MAX_NR_CON_DRIVER; i++) { |
@@ -3185,7 +3185,7 @@ int unbind_con_driver(const struct consw *csw, int first, int last, int deflt) | |||
3185 | } | 3185 | } |
3186 | 3186 | ||
3187 | if (retval) { | 3187 | if (retval) { |
3188 | release_console_sem(); | 3188 | console_unlock(); |
3189 | goto err; | 3189 | goto err; |
3190 | } | 3190 | } |
3191 | 3191 | ||
@@ -3204,12 +3204,12 @@ int unbind_con_driver(const struct consw *csw, int first, int last, int deflt) | |||
3204 | } | 3204 | } |
3205 | 3205 | ||
3206 | if (retval) { | 3206 | if (retval) { |
3207 | release_console_sem(); | 3207 | console_unlock(); |
3208 | goto err; | 3208 | goto err; |
3209 | } | 3209 | } |
3210 | 3210 | ||
3211 | if (!con_is_bound(csw)) { | 3211 | if (!con_is_bound(csw)) { |
3212 | release_console_sem(); | 3212 | console_unlock(); |
3213 | goto err; | 3213 | goto err; |
3214 | } | 3214 | } |
3215 | 3215 | ||
@@ -3238,7 +3238,7 @@ int unbind_con_driver(const struct consw *csw, int first, int last, int deflt) | |||
3238 | if (!con_is_bound(csw)) | 3238 | if (!con_is_bound(csw)) |
3239 | con_driver->flag &= ~CON_DRIVER_FLAG_INIT; | 3239 | con_driver->flag &= ~CON_DRIVER_FLAG_INIT; |
3240 | 3240 | ||
3241 | release_console_sem(); | 3241 | console_unlock(); |
3242 | /* ignore return value, binding should not fail */ | 3242 | /* ignore return value, binding should not fail */ |
3243 | bind_con_driver(defcsw, first, last, deflt); | 3243 | bind_con_driver(defcsw, first, last, deflt); |
3244 | err: | 3244 | err: |
@@ -3538,7 +3538,7 @@ int register_con_driver(const struct consw *csw, int first, int last) | |||
3538 | if (!try_module_get(owner)) | 3538 | if (!try_module_get(owner)) |
3539 | return -ENODEV; | 3539 | return -ENODEV; |
3540 | 3540 | ||
3541 | acquire_console_sem(); | 3541 | console_lock(); |
3542 | 3542 | ||
3543 | for (i = 0; i < MAX_NR_CON_DRIVER; i++) { | 3543 | for (i = 0; i < MAX_NR_CON_DRIVER; i++) { |
3544 | con_driver = ®istered_con_driver[i]; | 3544 | con_driver = ®istered_con_driver[i]; |
@@ -3592,7 +3592,7 @@ int register_con_driver(const struct consw *csw, int first, int last) | |||
3592 | } | 3592 | } |
3593 | 3593 | ||
3594 | err: | 3594 | err: |
3595 | release_console_sem(); | 3595 | console_unlock(); |
3596 | module_put(owner); | 3596 | module_put(owner); |
3597 | return retval; | 3597 | return retval; |
3598 | } | 3598 | } |
@@ -3613,7 +3613,7 @@ int unregister_con_driver(const struct consw *csw) | |||
3613 | { | 3613 | { |
3614 | int i, retval = -ENODEV; | 3614 | int i, retval = -ENODEV; |
3615 | 3615 | ||
3616 | acquire_console_sem(); | 3616 | console_lock(); |
3617 | 3617 | ||
3618 | /* cannot unregister a bound driver */ | 3618 | /* cannot unregister a bound driver */ |
3619 | if (con_is_bound(csw)) | 3619 | if (con_is_bound(csw)) |
@@ -3639,7 +3639,7 @@ int unregister_con_driver(const struct consw *csw) | |||
3639 | } | 3639 | } |
3640 | } | 3640 | } |
3641 | err: | 3641 | err: |
3642 | release_console_sem(); | 3642 | console_unlock(); |
3643 | return retval; | 3643 | return retval; |
3644 | } | 3644 | } |
3645 | EXPORT_SYMBOL(unregister_con_driver); | 3645 | EXPORT_SYMBOL(unregister_con_driver); |
@@ -3934,9 +3934,9 @@ int con_set_cmap(unsigned char __user *arg) | |||
3934 | { | 3934 | { |
3935 | int rc; | 3935 | int rc; |
3936 | 3936 | ||
3937 | acquire_console_sem(); | 3937 | console_lock(); |
3938 | rc = set_get_cmap (arg,1); | 3938 | rc = set_get_cmap (arg,1); |
3939 | release_console_sem(); | 3939 | console_unlock(); |
3940 | 3940 | ||
3941 | return rc; | 3941 | return rc; |
3942 | } | 3942 | } |
@@ -3945,9 +3945,9 @@ int con_get_cmap(unsigned char __user *arg) | |||
3945 | { | 3945 | { |
3946 | int rc; | 3946 | int rc; |
3947 | 3947 | ||
3948 | acquire_console_sem(); | 3948 | console_lock(); |
3949 | rc = set_get_cmap (arg,0); | 3949 | rc = set_get_cmap (arg,0); |
3950 | release_console_sem(); | 3950 | console_unlock(); |
3951 | 3951 | ||
3952 | return rc; | 3952 | return rc; |
3953 | } | 3953 | } |
@@ -3994,12 +3994,12 @@ static int con_font_get(struct vc_data *vc, struct console_font_op *op) | |||
3994 | } else | 3994 | } else |
3995 | font.data = NULL; | 3995 | font.data = NULL; |
3996 | 3996 | ||
3997 | acquire_console_sem(); | 3997 | console_lock(); |
3998 | if (vc->vc_sw->con_font_get) | 3998 | if (vc->vc_sw->con_font_get) |
3999 | rc = vc->vc_sw->con_font_get(vc, &font); | 3999 | rc = vc->vc_sw->con_font_get(vc, &font); |
4000 | else | 4000 | else |
4001 | rc = -ENOSYS; | 4001 | rc = -ENOSYS; |
4002 | release_console_sem(); | 4002 | console_unlock(); |
4003 | 4003 | ||
4004 | if (rc) | 4004 | if (rc) |
4005 | goto out; | 4005 | goto out; |
@@ -4076,12 +4076,12 @@ static int con_font_set(struct vc_data *vc, struct console_font_op *op) | |||
4076 | font.data = memdup_user(op->data, size); | 4076 | font.data = memdup_user(op->data, size); |
4077 | if (IS_ERR(font.data)) | 4077 | if (IS_ERR(font.data)) |
4078 | return PTR_ERR(font.data); | 4078 | return PTR_ERR(font.data); |
4079 | acquire_console_sem(); | 4079 | console_lock(); |
4080 | if (vc->vc_sw->con_font_set) | 4080 | if (vc->vc_sw->con_font_set) |
4081 | rc = vc->vc_sw->con_font_set(vc, &font, op->flags); | 4081 | rc = vc->vc_sw->con_font_set(vc, &font, op->flags); |
4082 | else | 4082 | else |
4083 | rc = -ENOSYS; | 4083 | rc = -ENOSYS; |
4084 | release_console_sem(); | 4084 | console_unlock(); |
4085 | kfree(font.data); | 4085 | kfree(font.data); |
4086 | return rc; | 4086 | return rc; |
4087 | } | 4087 | } |
@@ -4103,12 +4103,12 @@ static int con_font_default(struct vc_data *vc, struct console_font_op *op) | |||
4103 | else | 4103 | else |
4104 | name[MAX_FONT_NAME - 1] = 0; | 4104 | name[MAX_FONT_NAME - 1] = 0; |
4105 | 4105 | ||
4106 | acquire_console_sem(); | 4106 | console_lock(); |
4107 | if (vc->vc_sw->con_font_default) | 4107 | if (vc->vc_sw->con_font_default) |
4108 | rc = vc->vc_sw->con_font_default(vc, &font, s); | 4108 | rc = vc->vc_sw->con_font_default(vc, &font, s); |
4109 | else | 4109 | else |
4110 | rc = -ENOSYS; | 4110 | rc = -ENOSYS; |
4111 | release_console_sem(); | 4111 | console_unlock(); |
4112 | if (!rc) { | 4112 | if (!rc) { |
4113 | op->width = font.width; | 4113 | op->width = font.width; |
4114 | op->height = font.height; | 4114 | op->height = font.height; |
@@ -4124,7 +4124,7 @@ static int con_font_copy(struct vc_data *vc, struct console_font_op *op) | |||
4124 | if (vc->vc_mode != KD_TEXT) | 4124 | if (vc->vc_mode != KD_TEXT) |
4125 | return -EINVAL; | 4125 | return -EINVAL; |
4126 | 4126 | ||
4127 | acquire_console_sem(); | 4127 | console_lock(); |
4128 | if (!vc->vc_sw->con_font_copy) | 4128 | if (!vc->vc_sw->con_font_copy) |
4129 | rc = -ENOSYS; | 4129 | rc = -ENOSYS; |
4130 | else if (con < 0 || !vc_cons_allocated(con)) | 4130 | else if (con < 0 || !vc_cons_allocated(con)) |
@@ -4133,7 +4133,7 @@ static int con_font_copy(struct vc_data *vc, struct console_font_op *op) | |||
4133 | rc = 0; | 4133 | rc = 0; |
4134 | else | 4134 | else |
4135 | rc = vc->vc_sw->con_font_copy(vc, con); | 4135 | rc = vc->vc_sw->con_font_copy(vc, con); |
4136 | release_console_sem(); | 4136 | console_unlock(); |
4137 | return rc; | 4137 | return rc; |
4138 | } | 4138 | } |
4139 | 4139 | ||