Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc64/include/drivers/sgcn.h

    r253d3d0 ra71c158  
    3939#include <console/chardev.h>
    4040#include <proc/thread.h>
     41#include <synch/spinlock.h>
    4142
    4243/* number of bytes in the TOC magic, including the NULL-terminator */
    43 #define TOC_MAGIC_BYTES         8
     44#define TOC_MAGIC_BYTES  8
    4445
    4546/* number of bytes in the TOC key, including the NULL-terminator */
    46 #define TOC_KEY_SIZE            8
     47#define TOC_KEY_SIZE  8
    4748
    4849/* maximum number of entries in the SRAM table of contents */
    49 #define MAX_TOC_ENTRIES         32
     50#define MAX_TOC_ENTRIES  32
    5051
    5152/* number of bytes in the SGCN buffer magic, including the NULL-terminator */
    52 #define SGCN_MAGIC_BYTES        4
     53#define SGCN_MAGIC_BYTES  4
    5354
    5455/**
    5556 * Entry in the SRAM table of contents. Describes one segment of the SRAM
    5657 * which serves a particular purpose (e.g. OBP serial console, Solaris serial
    57  * console, Solaris mailbox,...). 
     58 * console, Solaris mailbox,...).
    5859 */
    5960typedef struct {
     
    8485/**
    8586 * SGCN buffer header. It is placed at the very beginning of the SGCN
    86  * buffer. 
     87 * buffer.
    8788 */
    8889typedef struct {
     
    104105        /** offset within the SGCN buffer of the input buffer write pointer */
    105106        uint32_t in_wrptr;
    106 
     107       
    107108        /** offset within the SGCN buffer of the output buffer start */
    108109        uint32_t out_begin;
     
    119120
    120121typedef struct {
     122        /** Starting address of SRAM */
     123        uintptr_t sram_begin;
     124       
     125        /** Starting address of the SGCN buffer */
     126        uintptr_t buffer_begin;
     127       
     128        /**
     129         * Ensure that writing to the buffer and consequent
     130         * update of the write pointer are one atomic operation.
     131         */
     132        SPINLOCK_DECLARE(output_lock);
     133       
     134        /**
     135         * Prevent the input buffer read/write pointers from
     136         * getting to inconsistent state.
     137         */
     138        SPINLOCK_DECLARE(input_lock);
     139       
    121140        thread_t *thread;
    122141        indev_t *srlnin;
    123142} sgcn_instance_t;
    124143
    125 extern void sgcn_grab(void);
    126 extern void sgcn_release(void);
    127144extern sgcn_instance_t *sgcnin_init(void);
    128145extern void sgcnin_wire(sgcn_instance_t *, indev_t *);
    129 extern void sgcnout_init(void);
     146extern outdev_t *sgcnout_init(void);
    130147
    131148#endif
Note: See TracChangeset for help on using the changeset viewer.