Changeset 18e0a6c in mainline for arch/ia32/src/asm.s


Ignore:
Timestamp:
2005-06-09T23:43:45Z (20 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
74df77d
Parents:
d896525
Message:

Implement several assembler functions in gcc's asm notation instead of in .s or .S file.
Gain both better speed and size.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • arch/ia32/src/asm.s

    rd896525 r18e0a6c  
    3131.text
    3232
    33 .global cpu_priority_high
    34 .global cpu_priority_low
    35 .global cpu_priority_restore
    36 .global cpu_priority_read
    3733.global cpu_halt
    3834.global cpu_sleep
    3935.global paging_on
    40 .global cpu_read_dba
    41 .global cpu_write_dba
    42 .global cpu_read_cr2
    4336.global enable_l_apic_in_msr
    4437.global interrupt_handlers
     
    5548
    5649
    57 ## Set priority level high
    58 #
    59 # Disable interrupts and return previous
    60 # EFLAGS in EAX.
    61 #
    62 cpu_priority_high:
    63         pushf
    64         pop %eax
    65         cli
    66         ret
    67 
    68 
    69 ## Set priority level low
    70 #
    71 # Enable interrupts and return previous
    72 # EFLAGS in EAX.
    73 #   
    74 cpu_priority_low:
    75         pushf
    76         pop %eax
    77         sti
    78         ret
    79 
    80 
    81 ## Restore priority level
    82 #
    83 # Restore EFLAGS.
    84 #
    85 cpu_priority_restore:
    86         push 4(%esp)
    87         popf
    88         ret
    89 
    90 ## Return raw priority level
    91 #
    92 # Return EFLAFS in EAX.
    93 #
    94 cpu_priority_read:
    95         pushf
    96         pop %eax
    97         ret
    98 
    99 
    100 ## Halt the CPU
    101 #
    102 # Halt the CPU using HLT.
    103 #
    104 cpu_halt:
    105 cpu_sleep:
    106         hlt
    107         ret
    108 
    109 
    11050## Turn paging on
    11151#
     
    12464
    12565
    126 ## Read CR3
    127 #
    128 # Store CR3 in EAX.
    129 #
    130 cpu_read_dba:
    131         movl %cr3,%eax
    132         ret
    133 
    134 
    135 ## Write CR3
    136 #
    137 # Set CR3.
    138 #
    139 cpu_write_dba:
    140         pushl %eax
    141         movl 8(%esp),%eax
    142         movl %eax,%cr3
    143         popl %eax
    144         ret
    145 
    146 
    147 ## Read CR2
    148 #
    149 # Store CR2 in EAX.
    150 #
    151 cpu_read_cr2:
    152         movl %cr2,%eax
    153         ret
    154 
    155 
    15666## Enable local APIC
    15767#
Note: See TracChangeset for help on using the changeset viewer.