Changeset da585a52 in mainline


Ignore:
Timestamp:
2005-05-11T18:58:54Z (19 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d7568a9f
Parents:
93ca46f
Message:

doxygen-style comments

Location:
arch/ia32
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • arch/ia32/_link.ld

    r93ca46f rda585a52  
    1 /*
    2  *  ia32 linker script
     1/** IA-32 linker script
    32 * 
    43 *  kernel text
  • arch/ia32/src/asm.s

    r93ca46f rda585a52  
    2727#
    2828
    29 # very low and hardware-level functions
     29## very low and hardware-level functions
    3030
    3131.text
     
    5454.global memcmp
    5555
    56 #
    57 # set priority level high
     56
     57## Set priority level high
     58#
     59# Disable interrupts and return previous
     60# EFLAGS in EAX.
     61#
    5862cpu_priority_high:
    5963        pushf
     
    6165        cli
    6266        ret
    63    
    64 #
    65 # set priority level low
     67
     68
     69## Set priority level low
     70#
     71# Enable interrupts and return previous
     72# EFLAGS in EAX.
     73#   
    6674cpu_priority_low:
    6775        pushf
     
    7078        ret
    7179
    72 #
    73 # restore priority level
     80
     81## Restore priority level
     82#
     83# Restore EFLAGS.
     84#
    7485cpu_priority_restore:
    7586        push 4(%esp)
     
    7788        ret
    7889
    79 # return raw priority level
     90## Return raw priority level
     91#
     92# Return EFLAFS in EAX.
     93#
    8094cpu_priority_read:
    8195        pushf
     
    8397        ret
    8498
     99
     100## Halt the CPU
     101#
     102# Halt the CPU using HLT.
     103#
    85104cpu_halt:
    86105cpu_sleep:
     
    88107        ret
    89108
     109
     110## Turn paging on
     111#
     112# Enable paging and write-back caching in CR0.
     113#
    90114paging_on:
    91115        pushl %eax
     
    99123        ret
    100124
     125
     126## Read CR3
     127#
     128# Store CR3 in EAX.
     129#
    101130cpu_read_dba:
    102131        movl %cr3,%eax
    103132        ret
    104133
     134
     135## Write CR3
     136#
     137# Set CR3.
     138#
    105139cpu_write_dba:
    106140        pushl %eax
     
    110144        ret
    111145
     146
     147## Read CR2
     148#
     149# Store CR2 in EAX.
     150#
    112151cpu_read_cr2:
    113152        movl %cr2,%eax
    114153        ret
    115154
     155
     156## Enable local APIC
     157#
     158# Enable local APIC in MSR.
     159#
    116160enable_l_apic_in_msr:
    117161        pusha
     
    126170        ret
    127171
     172
     173## Declare interrupt handlers
     174#
     175# Declare interrupt handlers for n interrupt
     176# vectors starting at vector i.
     177#
     178# The handlers setup data segment registers
     179# and call trap_dispatcher().
     180#
    128181.macro handler i n
    129182        push %ebp
     
    170223
    171224
     225## I/O input (byte)
     226#
     227# Get a byte from I/O port and store it AL.
     228#
    172229inb:
    173230        push %edx
     
    178235        ret
    179236
     237
     238## I/O input (word)
     239#
     240# Get a word from I/O port and store it AX.
     241#
    180242inw:
    181243        push %edx
     
    186248        ret
    187249
     250
     251## I/O input (dword)
     252#
     253# Get a dword from I/O port and store it EAX.
     254#
    188255inl:
    189256        push %edx
     
    194261        ret
    195262
     263
     264## I/O output (byte)
     265#
     266# Send a byte to I/O port.
     267#
    196268outb:
    197269        push %ebp
     
    207279        ret
    208280
     281
     282## I/O output (word)
     283#
     284# Send a word to I/O port.
     285#
    209286outw:
    210287        push %ebp
     
    220297        ret
    221298
     299
     300## I/O output (dword)
     301#
     302# Send a dword to I/O port.
     303#
    222304outl:
    223305        push %ebp
     
    233315        ret
    234316
     317
     318## Copy memory
     319#
     320# Copy a given number of bytes (3rd argument)
     321# from the memory location defined by 1st argument
     322# to the memory location defined by 2nd argument.
     323# The memory areas cannot overlap.
     324#
    235325SRC=8
    236326DST=12
     
    252342        ret
    253343
     344
     345## Fill memory with bytes
     346#
     347# Fill a given number of bytes (2nd argument)
     348# at memory defined by 1st argument with the
     349# byte value defined by 3rd argument.
     350#
     351DST=8
     352CNT=12
     353X=16
     354memsetb:
     355        push %ebp
     356        movl %esp,%ebp
     357        pusha
     358   
     359        cld
     360        movl CNT(%ebp),%ecx
     361        movl DST(%ebp),%edi
     362        movl X(%ebp),%eax
     363   
     364        rep stosb %al,%es:(%edi)
     365   
     366        popa
     367        pop %ebp
     368        ret
     369
     370
     371## Fill memory with words
     372#
     373# Fill a given number of words (2nd argument)
     374# at memory defined by 1st argument with the
     375# word value defined by 3rd argument.
     376#
    254377DST=8
    255378CNT=12
     
    271394        ret
    272395
    273 DST=8
    274 CNT=12
    275 X=16
    276 memsetb:
    277         push %ebp
    278         movl %esp,%ebp
    279         pusha
    280    
    281         cld
    282         movl CNT(%ebp),%ecx
    283         movl DST(%ebp),%edi
    284         movl X(%ebp),%eax
    285    
    286         rep stosb %al,%es:(%edi)
    287    
    288         popa
    289         pop %ebp
    290         ret
    291 
     396
     397## Compare memory regions for equality
     398#
     399# Compare a given number of bytes (3rd argument)
     400# at memory locations defined by 1st and 2nd argument
     401# for equality. If the bytes are equal, EAX contains
     402# 0.
     403#
    292404SRC=12
    293405DST=16
  • arch/ia32/src/context.s

    r93ca46f rda585a52  
    3636.global fpu_lazy_context_restore
    3737
     38
     39## Save current CPU context
    3840#
    39 # save context of this CPU
     41# Save CPU context to the kernel_context variable
     42# pointed by the 1st argument. Returns 1 in EAX.
     43#
    4044context_save:
    4145        push %ebx
     
    5963        incl %eax
    6064        ret
    61    
     65
     66
     67## Restore current CPU context
    6268#
    63 # restore saved context on this CPU
     69# Restore CPU context from the kernel_context variable
     70# pointed by the 1st argument. Returns 0 in EAX.
     71#   
    6472context_restore:
    6573        movl 4(%esp),%eax       # address of the kernel_context variable to restore context from
     
    7886        xorl %eax,%eax          # context_restore returns 0
    7987        ret
    80 
    81 
  • arch/ia32/src/cpuid.s

    r93ca46f rda585a52  
    2727#
    2828
    29 #
    30 # CPU identification functions.
    3129# The code below just interfaces the CPUID instruction.
    3230# CPU recognition logic is contained in higher-level functions.
     
    3836.global rdtsc
    3937
     38
     39## Determine CPUID support
     40#
     41# Return 0 in EAX if CPUID is not support, 1 if supported.
     42#
    4043has_cpuid:
    4144        push %ebx
     
    5659        ret
    5760
    58 # cpuid(__u32 cmd, struct cpu_info *info)
     61
     62## Get CPUID data
     63#
     64# This code is just an interfaces the CPUID instruction, CPU recognition
     65# logic is contained in higher-level functions.
     66#
     67# The C prototype is:
     68#   void cpuid(__u32 cmd, struct cpu_info *info)
     69#
     70# @param cmd  CPUID command.
     71# @param info Buffer to store CPUID output.
     72#
    5973cpuid:
    6074        pushl %ebp
  • arch/ia32/src/userspace.c

    r93ca46f rda585a52  
    3434#include <mm/vm.h>
    3535
     36
     37/** Enter userspace
     38 *
     39 * Change CPU protection level to 3, enter userspace.
     40 *
     41 */
    3642void userspace(void)
    3743{
     
    4854            "iret"
    4955            : : "i" (selector(UDATA_DES) | PL_USER), "i" (USTACK_ADDRESS+THREAD_STACK_SIZE-1000), "r" (pri), "i" (selector(UTEXT_DES) | PL_USER), "i" (UTEXT_ADDRESS));
    50         /* NOT REACHED */
    51 
     56       
     57        /* Unreachable */
    5258        for(;;);
    5359}
Note: See TracChangeset for help on using the changeset viewer.