Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 4343 → Rev 4344

/branches/dynload/kernel/arch/amd64/include/types.h
57,7 → 57,9
typedef uint64_t unative_t;
typedef int64_t native_t;
 
typedef uintptr_t ioport_t;
typedef volatile uint8_t ioport8_t;
typedef volatile uint16_t ioport16_t;
typedef volatile uint32_t ioport32_t;
 
typedef struct {
} fncptr_t;
/branches/dynload/kernel/arch/amd64/include/asm.h
73,7 → 73,7
* @param port Port to read from
* @return Value read
*/
static inline uint8_t pio_read_8(uint16_t port)
static inline uint8_t pio_read_8(ioport8_t *port)
{
uint8_t val;
 
81,6 → 81,36
return val;
}
 
/** Word from port
*
* Get word from port
*
* @param port Port to read from
* @return Value read
*/
static inline uint16_t pio_read_16(ioport16_t *port)
{
uint16_t val;
asm volatile ("inw %w1, %w0 \n" : "=a" (val) : "d" (port));
return val;
}
 
/** Double word from port
*
* Get double word from port
*
* @param port Port to read from
* @return Value read
*/
static inline uint32_t pio_read_32(ioport32_t *port)
{
uint32_t val;
asm volatile ("inl %w1, %0 \n" : "=a" (val) : "d" (port));
return val;
}
 
/** Byte to port
*
* Output byte to port
88,11 → 118,35
* @param port Port to write to
* @param val Value to write
*/
static inline void pio_write_8(uint16_t port, uint8_t val)
static inline void pio_write_8(ioport8_t *port, uint8_t val)
{
asm volatile ("outb %b0, %w1\n" : : "a" (val), "d" (port));
}
 
/** Word to port
*
* Output word to port
*
* @param port Port to write to
* @param val Value to write
*/
static inline void pio_write_16(ioport16_t *port, uint16_t val)
{
asm volatile ("outw %w0, %w1\n" : : "a" (val), "d" (port));
}
 
/** Double word to port
*
* Output double word to port
*
* @param port Port to write to
* @param val Value to write
*/
static inline void pio_write_32(ioport32_t *port, uint32_t val)
{
asm volatile ("outl %0, %w1\n" : : "a" (val), "d" (port));
}
 
/** Swap Hidden part of GS register with visible one */
static inline void swapgs(void)
{
/branches/dynload/kernel/arch/amd64/include/mm/frame.h
26,7 → 26,7
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
/** @addtogroup amd64mm
/** @addtogroup amd64mm
* @{
*/
/** @file
39,12 → 39,11
#include <arch/types.h>
#endif /* __ASM__ */
 
#define FRAME_WIDTH 12 /* 4K */
#define FRAME_SIZE (1 << FRAME_WIDTH)
#define FRAME_WIDTH 12 /* 4K */
#define FRAME_SIZE (1 << FRAME_WIDTH)
 
#ifndef __ASM__
extern uintptr_t last_frame;
extern uintptr_t end_frame;
extern void frame_arch_init(void);
extern void physmem_print(void);
#endif /* __ASM__ */
/branches/dynload/kernel/arch/amd64/include/mm/tlb.h
35,9 → 35,6
#ifndef KERN_amd64_TLB_H_
#define KERN_amd64_TLB_H_
 
#define tlb_arch_init()
#define tlb_print()
 
#endif
 
/** @}