Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 6886705 in mainline


Ignore:
Timestamp:
2017-10-02T20:13:41Z (4 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master
Children:
943aaf1b
Parents:
300f4c4
Message:

Move CUDA hw-related definitions to a separate header file.

Location:
uspace/srv/hw/bus/cuda_adb
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hw/bus/cuda_adb/cuda_adb.c

    r300f4c4 r6886705  
    5050#include <assert.h>
    5151#include "cuda_adb.h"
     52#include "cuda_hw.h"
    5253
    5354#define NAME  "cuda_adb"
     
    6869
    6970static void adb_packet_handle(uint8_t *data, size_t size, bool autopoll);
    70 
    71 
    72 /** B register fields */
    73 enum {
    74         TREQ    = 0x08,
    75         TACK    = 0x10,
    76         TIP     = 0x20
    77 };
    78 
    79 /** IER register fields */
    80 enum {
    81         IER_CLR = 0x00,
    82         IER_SET = 0x80,
    83 
    84         SR_INT  = 0x04,
    85         ALL_INT = 0x7f
    86 };
    87 
    88 /** ACR register fields */
    89 enum {
    90         SR_OUT  = 0x10
    91 };
    92 
    93 /** Packet types */
    94 enum {
    95         PT_ADB  = 0x00,
    96         PT_CUDA = 0x01
    97 };
    98 
    99 /** CUDA packet types */
    100 enum {
    101         CPT_AUTOPOLL    = 0x01
    102 };
    103 
    104 enum {
    105         ADB_MAX_ADDR    = 16
    106 };
    10771
    10872static irq_pio_range_t cuda_ranges[] = {
     
    172136        rc = loc_service_register("adb/kbd", &service_id);
    173137        if (rc != EOK) {
    174                 printf(NAME ": Unable to register service %s.\n", "adb/kdb");
     138                printf(NAME ": Unable to register service %s.\n", "adb/kbd");
    175139                return rc;
    176140        }
     
    181145        rc = loc_service_register("adb/mouse", &service_id);
    182146        if (rc != EOK) {
    183                 printf(NAME ": Unable to register servise %s.\n", "adb/mouse");
     147                printf(NAME ": Unable to register service %s.\n", "adb/mouse");
    184148                return rc;
    185149        }
  • uspace/srv/hw/bus/cuda_adb/cuda_adb.h

    r300f4c4 r6886705  
    3737#define CUDA_ADB_H_
    3838
     39#include <async.h>
     40#include <fibril_synch.h>
    3941#include <stddef.h>
    4042#include <stdint.h>
    41 #include <async.h>
    42 #include <fibril_synch.h>
    43 
    44 typedef struct {
    45         uint8_t b;
    46         uint8_t pad0[0x1ff];
    47 
    48         uint8_t a;
    49         uint8_t pad1[0x1ff];
    50 
    51         uint8_t dirb;
    52         uint8_t pad2[0x1ff];
    53 
    54         uint8_t dira;
    55         uint8_t pad3[0x1ff];
    56 
    57         uint8_t t1cl;
    58         uint8_t pad4[0x1ff];
    59 
    60         uint8_t t1ch;
    61         uint8_t pad5[0x1ff];
    62 
    63         uint8_t t1ll;
    64         uint8_t pad6[0x1ff];
    65 
    66         uint8_t t1lh;
    67         uint8_t pad7[0x1ff];
    68 
    69         uint8_t t2cl;
    70         uint8_t pad8[0x1ff];
    71 
    72         uint8_t t2ch;
    73         uint8_t pad9[0x1ff];
    74 
    75         uint8_t sr;
    76         uint8_t pad10[0x1ff];
    77 
    78         uint8_t acr;
    79         uint8_t pad11[0x1ff];
    80 
    81         uint8_t pcr;
    82         uint8_t pad12[0x1ff];
    83 
    84         uint8_t ifr;
    85         uint8_t pad13[0x1ff];
    86 
    87         uint8_t ier;
    88         uint8_t pad14[0x1ff];
    89 
    90         uint8_t anh;
    91         uint8_t pad15[0x1ff];
    92 } cuda_t;
    9343
    9444enum {
     
    11060
    11161typedef struct {
    112         cuda_t *cuda;
     62        struct cuda *cuda;
    11363        uintptr_t cuda_physical;
    11464
Note: See TracChangeset for help on using the changeset viewer.