[BACK]Return to fconsvar.h CVS log [TXT][DIR] Up to [local] / funnyos / dev / fcons

File: [local] / funnyos / dev / fcons / fconsvar.h (download)

Revision 1.3, Tue Oct 16 20:49:40 2007 UTC (16 years, 7 months ago) by init
Branch: MAIN
Changes since 1.2: +3 -1 lines

add fh_ownerdd to point at fcons_handle's owner's data for passing its (owner's) devdata into its (lower-level) funcs;
like we did in bus_handle

/*
 * $Id: fconsvar.h,v 1.3 2007/10/16 20:49:40 init Exp $
 */
#ifndef _DEV_FCONS_FCONSVAR_H
#define _DEV_FCONS_FCONSVAR_H

#define FCONS_WIDTH 	80
#define FCONS_HEIGHT 	25

#define NFCONS 1

struct fcons_devdata {
	/* current cursor position */
	uint8_t currow;
	uint8_t curcol;

};


struct fcons_handle {
	void 	*fh_ownerdd;	/* similar to bh_ownerdd in bus_handle; XXX kill this cause it is ugly */

	char 	(*getc)(struct device *);
	void	(*putc)(struct device *, char);
};


int 	fcons_devctl(struct device *devp, uint8_t ctl, void *data);
char 	fcons_getchar(struct device *devp);
void 	fcons_putchar(struct device *devp, char ch);

/* XXX */
//#define putchar(x) 	fcons_putchar()


/* devctl stuff */
#define DCFCONS_GETCURROW	0
#define DCFCONS_GETCURCOL	1
#define DCFCONS_PUTCHAR 	2
#define DCFCONS_GETCHAR 	3


#endif /* _DEV_FCONS_FCONSVAR_H */