cosmetic changes

This commit is contained in:
Stefan Lankes 2011-07-31 19:17:42 +02:00
parent 27ee238684
commit a26f88c940
3 changed files with 17 additions and 19 deletions

View file

@ -82,7 +82,6 @@ typedef struct {
unsigned short base_hi;
} __attribute__ ((packed)) idt_entry_t;
/** @brief Defines the idt pointer structure.
*
* This structure keeps information about
@ -95,8 +94,6 @@ typedef struct {
unsigned int base;
} __attribute__ ((packed)) idt_ptr_t;
/** @brief Installs IDT
*
* The installation involves the following steps:
@ -113,7 +110,7 @@ void idt_install(void);
* @param sel Segment the IDT will use
* @param flags Flags this entry will have
*/
void idt_set_gate(unsigned char num, unsigned long base, unsigned short sel,
void idt_set_gate(unsigned char num, size_t base, unsigned short sel,
unsigned char flags);
/** @brief Configures and returns a IDT entry with chosen attributes
@ -123,7 +120,7 @@ void idt_set_gate(unsigned char num, unsigned long base, unsigned short sel,
*
* @return a preconfigured idt descriptor
*/
idt_entry_t configure_idt_entry(unsigned long base, unsigned short sel,
idt_entry_t configure_idt_entry(size_t base, unsigned short sel,
unsigned char flags);
#ifdef __cplusplus

View file

@ -41,17 +41,8 @@
*/
static idt_entry_t idt[256] = {[0 ... 255] = {0, 0, 0, 0, 0}};
static idt_ptr_t idtp;
/*
* Use this function to set an entry in the IDT. Alot simpler
* than twiddling with the GDT ;)
*/
void idt_set_gate(unsigned char num, unsigned long base, unsigned short sel,
unsigned char flags)
{
idt[num] = configure_idt_entry(base, sel, flags);
}
idt_entry_t configure_idt_entry(unsigned long base, unsigned short sel,
idt_entry_t configure_idt_entry(size_t base, unsigned short sel,
unsigned char flags)
{
idt_entry_t desc;
@ -69,6 +60,16 @@ idt_entry_t configure_idt_entry(unsigned long base, unsigned short sel,
return desc;
}
/*
* Use this function to set an entry in the IDT. Alot simpler
* than twiddling with the GDT ;)
*/
void idt_set_gate(unsigned char num, size_t base, unsigned short sel,
unsigned char flags)
{
idt[num] = configure_idt_entry(base, sel, flags);
}
extern void isrsyscall(void);
/* Installs the IDT */
@ -84,7 +85,7 @@ void idt_install(void)
idtp.base = (unsigned int)&idt;
/* Add any new ISRs to the IDT here using idt_set_gate */
idt_set_gate(INT_SYSCALL, (unsigned int)isrsyscall, KERNEL_CODE_SELECTOR,
idt_set_gate(INT_SYSCALL, (size_t)isrsyscall, KERNEL_CODE_SELECTOR,
IDT_FLAG_PRESENT|IDT_FLAG_RING3|IDT_FLAG_32BIT|IDT_FLAG_TRAPGATE);
}

View file

@ -237,7 +237,7 @@ static void rtl8139if_handler(struct state* s)
uint16_t isr_contents;
while (1) {
isr_contents = inportw(rtl8139if->iobase + ISR);
isr_contents = inportw(rtl8139if->iobase + ISR);
if (isr_contents == 0)
break;
@ -398,7 +398,7 @@ err_t rtl8139if_init(struct netif* netif)
}
if (!tmp16) {
// it seems not to work
// it seems not to work
kprintf("RTL8139 reset failed\n");
return ERR_ARG;
}
@ -416,7 +416,7 @@ err_t rtl8139if_init(struct netif* netif)
outportb(rtl8139if->iobase + CONFIG1,
(inportb(rtl8139if->iobase + CONFIG1) & ~(CONFIG1_DVRLOAD | CONFIG1_LWACT)) | CONFIG1_DVRLOAD);
// unlock config register
// unlock config register
outportb(rtl8139if->iobase + CR9346, 0);
/*