Changeset 593e023 in mainline for uspace/lib/c


Ignore:
Timestamp:
2014-08-12T17:14:32Z (11 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c3bdc92
Parents:
ce3efa0
Message:

allow compositor and console to coexist side-by-side, use the input server as a poor man's seat arbitrator

  • kernel console notifies both about the release and grab events
  • input server arbitrates the seat selection between kernel console and any number of user space UIs (currently the console server and the compositor server)
  • input port yield and reclaim methods have been removed (they are used only on Ski and Niagara, both already need a more generic mechanism for the kernel/user space cooperation)
  • console and compositor server keep track of the kernel console via the input arbitration
  • move the waiting for a character device from init and terminal widget to getterm
Location:
uspace/lib/c
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/io/input.c

    rce3efa0 r593e023  
    8080}
    8181
    82 int input_yield(input_t *input)
     82int input_activate(input_t *input)
    8383{
    8484        async_exch_t *exch = async_exchange_begin(input->sess);
    85         int rc = async_req_0_0(exch, INPUT_YIELD);
     85        int rc = async_req_0_0(exch, INPUT_ACTIVATE);
    8686        async_exchange_end(exch);
    8787       
     
    8989}
    9090
    91 int input_reclaim(input_t *input)
    92 {
    93         async_exch_t *exch = async_exchange_begin(input->sess);
    94 
    95         int rc = async_req_0_0(exch, INPUT_RECLAIM);
    96         async_exchange_end(exch);
    97 
    98         return rc;
     91static void input_ev_active(input_t *input, ipc_callid_t callid,
     92    ipc_call_t *call)
     93{
     94        int rc = input->ev_ops->active(input);
     95        async_answer_0(callid, rc);
     96}
     97
     98static void input_ev_deactive(input_t *input, ipc_callid_t callid,
     99    ipc_call_t *call)
     100{
     101        int rc = input->ev_ops->deactive(input);
     102        async_answer_0(callid, rc);
    99103}
    100104
     
    177181
    178182                switch (IPC_GET_IMETHOD(call)) {
     183                case INPUT_EVENT_ACTIVE:
     184                        input_ev_active(input, callid, &call);
     185                        break;
     186                case INPUT_EVENT_DEACTIVE:
     187                        input_ev_deactive(input, callid, &call);
     188                        break;
    179189                case INPUT_EVENT_KEY:
    180190                        input_ev_key(input, callid, &call);
  • uspace/lib/c/include/io/input.h

    rce3efa0 r593e023  
    4949
    5050typedef struct input_ev_ops {
     51        int (*active)(input_t *);
     52        int (*deactive)(input_t *);
    5153        int (*key)(input_t *, kbd_event_type_t, keycode_t, keymod_t, wchar_t);
    5254        int (*move)(input_t *, int, int);
     
    5759extern int input_open(async_sess_t *, input_ev_ops_t *, void *, input_t **);
    5860extern void input_close(input_t *);
    59 extern int input_yield(input_t *);
    60 extern int input_reclaim(input_t *);
     61extern int input_activate(input_t *);
    6162
    6263#endif
  • uspace/lib/c/include/ipc/input.h

    rce3efa0 r593e023  
    3939
    4040typedef enum {
    41         INPUT_YIELD = IPC_FIRST_USER_METHOD,
    42         INPUT_RECLAIM
     41        INPUT_ACTIVATE = IPC_FIRST_USER_METHOD
    4342} input_request_t;
    4443
    4544typedef enum {
    46         INPUT_EVENT_KEY = IPC_FIRST_USER_METHOD,
     45        INPUT_EVENT_ACTIVE = IPC_FIRST_USER_METHOD,
     46        INPUT_EVENT_DEACTIVE,
     47        INPUT_EVENT_KEY,
    4748        INPUT_EVENT_MOVE,
    4849        INPUT_EVENT_ABS_MOVE,
Note: See TracChangeset for help on using the changeset viewer.