UNIX xv6 (rev8, 9/1/15)
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Macros | Functions | Variables
lapic.c File Reference
#include "types.h"
#include "defs.h"
#include "date.h"
#include "memlayout.h"
#include "traps.h"
#include "mmu.h"
#include "x86.h"

Go to the source code of this file.

Macros

#define ID   (0x0020/4)
 
#define VER   (0x0030/4)
 
#define TPR   (0x0080/4)
 
#define EOI   (0x00B0/4)
 
#define SVR   (0x00F0/4)
 
#define ENABLE   0x00000100
 
#define ESR   (0x0280/4)
 
#define ICRLO   (0x0300/4)
 
#define INIT   0x00000500
 
#define STARTUP   0x00000600
 
#define DELIVS   0x00001000
 
#define ASSERT   0x00004000
 
#define DEASSERT   0x00000000
 
#define LEVEL   0x00008000
 
#define BCAST   0x00080000
 
#define BUSY   0x00001000
 
#define FIXED   0x00000000
 
#define ICRHI   (0x0310/4)
 
#define TIMER   (0x0320/4)
 
#define X1   0x0000000B
 
#define PERIODIC   0x00020000
 
#define PCINT   (0x0340/4)
 
#define LINT0   (0x0350/4)
 
#define LINT1   (0x0360/4)
 
#define ERROR   (0x0370/4)
 
#define MASKED   0x00010000
 
#define TICR   (0x0380/4)
 
#define TCCR   (0x0390/4)
 
#define TDCR   (0x03E0/4)
 
#define CMOS_PORT   0x70
 
#define CMOS_RETURN   0x71
 
#define CMOS_STATA   0x0a
 
#define CMOS_STATB   0x0b
 
#define CMOS_UIP   (1 << 7)
 
#define SECS   0x00
 
#define MINS   0x02
 
#define HOURS   0x04
 
#define DAY   0x07
 
#define MONTH   0x08
 
#define YEAR   0x09
 
#define CONV(x)   (t1.x = ((t1.x >> 4) * 10) + (t1.x & 0xf))
 

Functions

void lapicinit (void)
 
int cpunum (void)
 
void lapiceoi (void)
 
void microdelay (int us)
 
void lapicstartap (uchar apicid, uint addr)
 
void cmostime (struct rtcdate *r)
 

Variables

volatile uintlapic
 

Macro Definition Documentation

#define ASSERT   0x00004000

Definition at line 24 of file lapic.c.

#define BCAST   0x00080000

Definition at line 27 of file lapic.c.

#define BUSY   0x00001000

Definition at line 28 of file lapic.c.

#define CMOS_PORT   0x70

Definition at line 134 of file lapic.c.

#define CMOS_RETURN   0x71

Definition at line 135 of file lapic.c.

#define CMOS_STATA   0x0a

Definition at line 174 of file lapic.c.

#define CMOS_STATB   0x0b

Definition at line 175 of file lapic.c.

#define CMOS_UIP   (1 << 7)

Definition at line 176 of file lapic.c.

#define CONV (   x)    (t1.x = ((t1.x >> 4) * 10) + (t1.x & 0xf))
#define DAY   0x07

Definition at line 181 of file lapic.c.

#define DEASSERT   0x00000000

Definition at line 25 of file lapic.c.

#define DELIVS   0x00001000

Definition at line 23 of file lapic.c.

#define ENABLE   0x00000100

Definition at line 18 of file lapic.c.

#define EOI   (0x00B0/4)

Definition at line 16 of file lapic.c.

#define ERROR   (0x0370/4)

Definition at line 37 of file lapic.c.

#define ESR   (0x0280/4)

Definition at line 19 of file lapic.c.

#define FIXED   0x00000000

Definition at line 29 of file lapic.c.

#define HOURS   0x04

Definition at line 180 of file lapic.c.

#define ICRHI   (0x0310/4)

Definition at line 30 of file lapic.c.

#define ICRLO   (0x0300/4)

Definition at line 20 of file lapic.c.

#define ID   (0x0020/4)

Definition at line 13 of file lapic.c.

#define INIT   0x00000500

Definition at line 21 of file lapic.c.

#define LEVEL   0x00008000

Definition at line 26 of file lapic.c.

#define LINT0   (0x0350/4)

Definition at line 35 of file lapic.c.

#define LINT1   (0x0360/4)

Definition at line 36 of file lapic.c.

#define MASKED   0x00010000

Definition at line 38 of file lapic.c.

#define MINS   0x02

Definition at line 179 of file lapic.c.

#define MONTH   0x08

Definition at line 182 of file lapic.c.

#define PCINT   (0x0340/4)

Definition at line 34 of file lapic.c.

#define PERIODIC   0x00020000

Definition at line 33 of file lapic.c.

#define SECS   0x00

Definition at line 178 of file lapic.c.

#define STARTUP   0x00000600

Definition at line 22 of file lapic.c.

#define SVR   (0x00F0/4)

Definition at line 17 of file lapic.c.

#define TCCR   (0x0390/4)

Definition at line 40 of file lapic.c.

#define TDCR   (0x03E0/4)

Definition at line 41 of file lapic.c.

#define TICR   (0x0380/4)

Definition at line 39 of file lapic.c.

#define TIMER   (0x0320/4)

Definition at line 31 of file lapic.c.

#define TPR   (0x0080/4)

Definition at line 15 of file lapic.c.

#define VER   (0x0030/4)

Definition at line 14 of file lapic.c.

#define X1   0x0000000B

Definition at line 32 of file lapic.c.

#define YEAR   0x09

Definition at line 183 of file lapic.c.

Function Documentation

void cmostime ( struct rtcdate r)

Definition at line 204 of file lapic.c.

int cpunum ( void  )

Definition at line 100 of file lapic.c.

void lapiceoi ( void  )

Definition at line 121 of file lapic.c.

void lapicinit ( void  )

Definition at line 54 of file lapic.c.

void lapicstartap ( uchar  apicid,
uint  addr 
)

Definition at line 140 of file lapic.c.

void microdelay ( int  us)

Definition at line 130 of file lapic.c.

Variable Documentation

volatile uint* lapic

Definition at line 43 of file lapic.c.