]> git.sur5r.net Git - freertos/blob - Source/portable/GCC/ColdFire_V2/portasm.S
First task starting.
[freertos] / Source / portable / GCC / ColdFire_V2 / portasm.S
1 \r
2 /*\r
3  * File:    mcf5xxx.s\r
4  * Purpose: Lowest level routines for all ColdFire processors.\r
5  *\r
6  * Notes:\r
7  *\r
8  * Function copied from mcf5xxx.S provided by FreeScale.\r
9  */\r
10 \r
11     .global ulPortSetIPL\r
12 \r
13     .text\r
14 \r
15 /********************************************************************/\r
16 /*\r
17  * This routines changes the IPL to the value passed into the routine.\r
18  * It also returns the old IPL value back.\r
19  * Calling convention from C:\r
20  *   old_ipl = asm_set_ipl(new_ipl);\r
21  * For the Diab Data C compiler, it passes return value thru D0.\r
22  * Note that only the least significant three bits of the passed\r
23  * value are used.\r
24  */\r
25 \r
26 ulPortSetIPL:\r
27     link    A6,#-8\r
28     movem.l D6-D7,(SP)\r
29 \r
30     move.w  SR,D7       /* current sr    */\r
31 \r
32     move.l  D7,D0       /* prepare return value  */\r
33     andi.l  #0x0700,D0  /* mask out IPL  */\r
34     lsr.l   #8,D0       /* IPL   */\r
35 \r
36     move.l  8(A6),D6    /* get argument  */\r
37     andi.l  #0x07,D6        /* least significant three bits  */\r
38     lsl.l   #8,D6       /* move over to make mask    */\r
39 \r
40     andi.l  #0x0000F8FF,D7  /* zero out current IPL  */\r
41     or.l    D6,D7           /* place new IPL in sr   */\r
42     move.w  D7,SR\r
43 \r
44     movem.l (SP),D6-D7\r
45     lea     8(SP),SP\r
46     unlk    A6\r
47     rts\r
48 \r
49 /********************************************************************/\r
50     .end\r
51 \r
52 \r