Voxia OS v0.0.1
Hobby Project Operating System Targeting x86-64
Loading...
Searching...
No Matches
dev.h File Reference
#include <type.h>

Go to the source code of this file.

Data Structures

struct  cdev
 

Macros

#define DEV_MAJOR_MAX_COUNT   256
 
#define DEV_MINOR_BITMAP_COUNT   32
 
#define DEV_MAJOR_MEM   1
 
#define DEV_MAJOR_FD   2
 
#define DEV_MAJOR_HD   3
 
#define DEV_MAJOR_TTY   4
 
#define DEV_MAJOR_CONSOLE   5
 
#define DEV_MAJOR_LP   6
 
#define DEV_MAJOR_VCS   7
 
#define DEV_MAJOR_SCSI_DISK   8
 
#define DEV_MAJOR_MD   9
 
#define DEV_MAJOR_NET   10
 
#define DEV_MAJOR_CDROM   11
 
#define DEV_MAJOR_INPUT   12
 
#define DEV_MAJOR_AUDIO   13
 
#define DEV_MAJOR_USB   14
 
#define DEV_MAJOR_FB   15
 
#define DEV_MAJOR_PTY   16
 
#define DEV_MAJOR_SERIAL   17
 
#define DEV_MAJOR_RTC   18
 
#define DEV_MAJOR_NVME   19
 
#define DEV_MAJOR_LOOP   20
 

Typedefs

typedef char dev_name_t[128]
 
typedef cdev_t * cdev_ptr_t
 

Enumerations

enum  { ERR_DEV_OPS_NOT_IMPLEMENTED = -3 , DEV_OK = 1 }
 

Functions

struct cdev __attribute__ ((aligned(64))) cdev_t
 
cdev_ptr_t create_dev (void *ops, uint32_t major)
 
cdev_ptr_t retrieve_dev (uint32_t major, uint32_t minor)
 

Variables

uint32_t major
 
uint32_t minor
 
void * ops
 
struct cdevnext
 

Macro Definition Documentation

◆ DEV_MAJOR_AUDIO

#define DEV_MAJOR_AUDIO   13

Definition at line 42 of file dev.h.

◆ DEV_MAJOR_CDROM

#define DEV_MAJOR_CDROM   11

Definition at line 40 of file dev.h.

Referenced by ATAPIModule::identify().

◆ DEV_MAJOR_CONSOLE

#define DEV_MAJOR_CONSOLE   5

Definition at line 33 of file dev.h.

◆ DEV_MAJOR_FB

#define DEV_MAJOR_FB   15

Definition at line 44 of file dev.h.

◆ DEV_MAJOR_FD

#define DEV_MAJOR_FD   2

Definition at line 30 of file dev.h.

◆ DEV_MAJOR_HD

#define DEV_MAJOR_HD   3

Definition at line 31 of file dev.h.

◆ DEV_MAJOR_INPUT

#define DEV_MAJOR_INPUT   12

Definition at line 41 of file dev.h.

◆ DEV_MAJOR_LOOP

#define DEV_MAJOR_LOOP   20

Definition at line 49 of file dev.h.

◆ DEV_MAJOR_LP

#define DEV_MAJOR_LP   6

Definition at line 34 of file dev.h.

◆ DEV_MAJOR_MAX_COUNT

#define DEV_MAJOR_MAX_COUNT   256

Definition at line 26 of file dev.h.

◆ DEV_MAJOR_MD

#define DEV_MAJOR_MD   9

Definition at line 37 of file dev.h.

◆ DEV_MAJOR_MEM

#define DEV_MAJOR_MEM   1

Definition at line 29 of file dev.h.

◆ DEV_MAJOR_NET

#define DEV_MAJOR_NET   10

Definition at line 38 of file dev.h.

◆ DEV_MAJOR_NVME

#define DEV_MAJOR_NVME   19

Definition at line 48 of file dev.h.

◆ DEV_MAJOR_PTY

#define DEV_MAJOR_PTY   16

Definition at line 45 of file dev.h.

◆ DEV_MAJOR_RTC

#define DEV_MAJOR_RTC   18

Definition at line 47 of file dev.h.

◆ DEV_MAJOR_SCSI_DISK

#define DEV_MAJOR_SCSI_DISK   8

Definition at line 36 of file dev.h.

◆ DEV_MAJOR_SERIAL

#define DEV_MAJOR_SERIAL   17

Definition at line 46 of file dev.h.

◆ DEV_MAJOR_TTY

#define DEV_MAJOR_TTY   4

Definition at line 32 of file dev.h.

Referenced by configure_tty().

◆ DEV_MAJOR_USB

#define DEV_MAJOR_USB   14

Definition at line 43 of file dev.h.

◆ DEV_MAJOR_VCS

#define DEV_MAJOR_VCS   7

Definition at line 35 of file dev.h.

◆ DEV_MINOR_BITMAP_COUNT

#define DEV_MINOR_BITMAP_COUNT   32

Definition at line 27 of file dev.h.

Referenced by alloc_minor().

Typedef Documentation

◆ cdev_ptr_t

typedef cdev_t* cdev_ptr_t

Definition at line 70 of file dev.h.

◆ dev_name_t

typedef char dev_name_t[128]

Definition at line 55 of file dev.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ERR_DEV_OPS_NOT_IMPLEMENTED 
DEV_OK 

Definition at line 57 of file dev.h.

Function Documentation

◆ __attribute__()

struct cdev __attribute__ ( (aligned(64)) )

Definition at line 1 of file core.h.

◆ create_dev()

cdev_ptr_t create_dev ( void * ops,
uint32_t major )

◆ retrieve_dev()

cdev_ptr_t retrieve_dev ( uint32_t major,
uint32_t minor )

References major, minor, and retrieve_dev().

Referenced by __attribute__(), and retrieve_dev().

Variable Documentation

◆ major

uint32_t major

Definition at line 0 of file dev.h.

Referenced by __attribute__(), alloc_minor(), create_dev(), and retrieve_dev().

◆ minor

uint32_t minor

Definition at line 1 of file dev.h.

Referenced by __attribute__(), and retrieve_dev().

◆ next

◆ ops