Chameleon

Chameleon Commit Details

Date:2015-08-25 18:53:54 (3 years 9 months ago)
Author:ErmaC
Commit:2754
Parents: 2753
Message:clang compilation fix (3.7 / xcode 7.0) errors on compiling interrupts.c (credits to cmf_)
Changes:
M/branches/ErmaC/Enoch/i386/libsa/interrupts.c

File differences

branches/ErmaC/Enoch/i386/libsa/interrupts.c
8484
8585
8686
87
88
89
9087
9188
9289
......
107104
108105
109106
110
111107
112108
113109
......
132128
133129
134130
135
136131
137132
138133
......
197192
198193
199194
200
201
202
203
204
205
206
195
207196
208
209
210
211
212
197
198
199
200
201
213202
203
204
214205
215206
216207
static
uint32_t lapic_base = 0U;
static
uint8_t const PicPorts[2][2] = { { 0x20U, 0x21U }, { 0xA0U, 0xA1U } };
#pragma mark -
#pragma mark Assembly Stubs
#pragma mark -
"addl $4, %%esp\n\t"
"iretl"
:);
__builtin_unreachable();
}
static
"addl $8, %%esp\n\t"
"iretl"
:);
__builtin_unreachable();
}
/*
*(uint32_t volatile*) (lapic_base + offset) = value;
}
static inline
uint8_t ReadPic(int pic, int index)
{
uint8_t value;
__asm__ volatile ("inb %1, %0" : "=a"(value) : "N"(PicPorts[pic][index]));
return value;
}
#define ChoosePicPort(pic, index) (pic == 0 ? (index == 0 ? 0x20U : 0x21U) : (index == 0 ? 0xA0U : 0xA1U))
static inline
void WritePic(int pic, int index, uint8_t value)
{
__asm__ volatile ("outb %0, %1" : : "a"(value), "N"(PicPorts[pic][index]));
}
#define ReadPic(pic, index) ({ \
uint8_t value; \
__asm__ volatile ("inb %1, %0" : "=a"(value) : "N"(ChoosePicPort(pic, index))); \
value; \
})
#define WritePic(pic, index, value) __asm__ volatile ("outb %0, %1" : : "a"((uint8_t)value), "N"(ChoosePicPort(pic, index)))
#pragma mark -
#pragma mark Main Code
#pragma mark -

Archive Download the corresponding diff file

Revision: 2754