Changeset c632c96 in mainline for uspace/lib/congfx/src/console.c


Ignore:
Timestamp:
2021-10-25T00:32:45Z (2 years ago)
Author:
jxsvoboda <5887334+jxsvoboda@…>
Branches:
master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
39ab17c
Parents:
f59212cc
git-author:
Jiri Svoboda <jiri@…> (2021-10-20 22:22:04)
git-committer:
jxsvoboda <5887334+jxsvoboda@…> (2021-10-25 00:32:45)
Message:

Unmap and clear console before executing a binary

Fixes running edit, nav, improves fdisk, etc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/congfx/src/console.c

    rf59212cc rc632c96  
    281281}
    282282
     283/** Free up console for other users, suspending GC operation.
     284 *
     285 * @param cgc Console GC
     286 * @return EOK on success or an error code
     287 */
     288errno_t console_gc_suspend(console_gc_t *cgc)
     289{
     290        console_unmap(cgc->con, cgc->buf);
     291        cgc->buf = NULL;
     292
     293        console_clear(cgc->con);
     294        console_cursor_visibility(cgc->con, true);
     295        return EOK;
     296}
     297
     298/** Resume GC operation after suspend.
     299 *
     300 * @param cgc Console GC
     301 * @return EOK on success or an error code
     302 */
     303errno_t console_gc_resume(console_gc_t *cgc)
     304{
     305        errno_t rc;
     306
     307        console_clear(cgc->con);
     308
     309        rc = console_map(cgc->con, cgc->rect.p1.x, cgc->rect.p1.y, &cgc->buf);
     310        if (rc != EOK)
     311                return rc;
     312
     313        return EOK;
     314}
     315
    283316/** Get generic graphic context from console GC.
    284317 *
Note: See TracChangeset for help on using the changeset viewer.