Changeset 10c071e in mainline for arch/sparc64


Ignore:
Timestamp:
2005-12-15T16:57:48Z (20 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6c68b97
Parents:
b4cad8b2
Message:

Fix ia64 and sparc64 to compile with new atomic_t.
Fix rwlock test #5 and semaphore test #1 to compile with new atomic_t.

sparc64 work.
TBA must be set before a function call when MMU is switched off.

Location:
arch/sparc64
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • arch/sparc64/include/atomic.h

    rb4cad8b2 r10c071e  
    3939 */
    4040
    41 static inline void atomic_inc(atomic_t *val) {
     41static inline void atomic_inc(atomic_t *val)
     42{
    4243        val->count++;
    4344}
    4445
    45 static inline void atomic_dec(atomic_t *val) {
     46static inline void atomic_dec(atomic_t *val)
     47{
    4648        val->count--;
    4749}
    4850
     51static inline void atomic_set(atomic_t *val, __u64 i)
     52{
     53        val->count = i;
     54}
     55
     56static inline __u64 atomic_get(atomic_t *val)
     57{
     58        return val->count;
     59}
     60
    4961#endif
  • arch/sparc64/include/trap.h

    rb4cad8b2 r10c071e  
    3030#define __sparc64_TRAP_H__
    3131
     32#include <arch/trap_table.h>
     33#include <arch/asm.h>
     34
     35/** Switch to in-kernel trap table. */
     36static inline void trap_switch_trap_table(void)
     37{
     38        /* Point TBA to kernel copy of OFW's trap table. */
     39        tba_write((__u64) trap_table);
     40}
     41
    3242extern void trap_init(void);
    3343
  • arch/sparc64/src/mm/tlb.c

    rb4cad8b2 r10c071e  
    3636#include <typedefs.h>
    3737#include <config.h>
     38#include <arch/trap.h>
    3839
    3940/** Initialize ITLB and DTLB.
     
    4445 * After TLB is initialized, MMU is enabled
    4546 * again.
     47 *
     48 * Switching MMU off imposes the requirement for
     49 * the kernel to run in identity mapped environment.
    4650 */
    4751void tlb_arch_init(void)
     
    8286        dtlb_data_in_write(data.value);
    8387
     88        /*
     89         * Register window traps can occur before MMU is enabled again.
     90         * This ensures that any such traps will be handled from
     91         * kernel identity mapped trap handler.
     92         */
     93        trap_switch_trap_table();
     94       
    8495        tlb_invalidate_all();
    8596
  • arch/sparc64/src/sparc64.c

    rb4cad8b2 r10c071e  
    3636{
    3737        ofw_sparc64_console_init();
     38        trap_init();
    3839}
    3940
     
    4445void arch_pre_smp_init(void)
    4546{
    46         trap_init();
    4747}
    4848
  • arch/sparc64/src/trap.c

    rb4cad8b2 r10c071e  
    3232#include <memstr.h>
    3333
     34/** Initialize trap table. */
    3435void trap_init(void)
    3536{
     
    3839         */
    3940        memcpy((void *) trap_table, (void *) tba_read(), TRAP_TABLE_SIZE);
    40 
    41         /* Point TBA to kernel copy of OFW's trap table. */
    42         tba_write((__u64) trap_table);
    4341}
Note: See TracChangeset for help on using the changeset viewer.