...
Run Format

Text file src/runtime/sys_linux_arm.s

Documentation: runtime

     1	// Copyright 2009 The Go Authors. All rights reserved.
     2	// Use of this source code is governed by a BSD-style
     3	// license that can be found in the LICENSE file.
     4	
     5	//
     6	// System calls and other sys.stuff for arm, Linux
     7	//
     8	
     9	#include "go_asm.h"
    10	#include "go_tls.h"
    11	#include "textflag.h"
    12	
    13	#define CLOCK_REALTIME	0
    14	#define CLOCK_MONOTONIC	1
    15	
    16	// for EABI, as we don't support OABI
    17	#define SYS_BASE 0x0
    18	
    19	#define SYS_exit (SYS_BASE + 1)
    20	#define SYS_read (SYS_BASE + 3)
    21	#define SYS_write (SYS_BASE + 4)
    22	#define SYS_open (SYS_BASE + 5)
    23	#define SYS_close (SYS_BASE + 6)
    24	#define SYS_getpid (SYS_BASE + 20)
    25	#define SYS_kill (SYS_BASE + 37)
    26	#define SYS_clone (SYS_BASE + 120)
    27	#define SYS_rt_sigreturn (SYS_BASE + 173)
    28	#define SYS_rt_sigaction (SYS_BASE + 174)
    29	#define SYS_rt_sigprocmask (SYS_BASE + 175)
    30	#define SYS_sigaltstack (SYS_BASE + 186)
    31	#define SYS_mmap2 (SYS_BASE + 192)
    32	#define SYS_futex (SYS_BASE + 240)
    33	#define SYS_exit_group (SYS_BASE + 248)
    34	#define SYS_munmap (SYS_BASE + 91)
    35	#define SYS_madvise (SYS_BASE + 220)
    36	#define SYS_setitimer (SYS_BASE + 104)
    37	#define SYS_mincore (SYS_BASE + 219)
    38	#define SYS_gettid (SYS_BASE + 224)
    39	#define SYS_tkill (SYS_BASE + 238)
    40	#define SYS_sched_yield (SYS_BASE + 158)
    41	#define SYS_nanosleep (SYS_BASE + 162)
    42	#define SYS_sched_getaffinity (SYS_BASE + 242)
    43	#define SYS_clock_gettime (SYS_BASE + 263)
    44	#define SYS_epoll_create (SYS_BASE + 250)
    45	#define SYS_epoll_ctl (SYS_BASE + 251)
    46	#define SYS_epoll_wait (SYS_BASE + 252)
    47	#define SYS_epoll_create1 (SYS_BASE + 357)
    48	#define SYS_fcntl (SYS_BASE + 55)
    49	#define SYS_access (SYS_BASE + 33)
    50	#define SYS_connect (SYS_BASE + 283)
    51	#define SYS_socket (SYS_BASE + 281)
    52	#define SYS_brk (SYS_BASE + 45)
    53	
    54	#define ARM_BASE (SYS_BASE + 0x0f0000)
    55	
    56	TEXT runtime·open(SB),NOSPLIT,$0
    57		MOVW	name+0(FP), R0
    58		MOVW	mode+4(FP), R1
    59		MOVW	perm+8(FP), R2
    60		MOVW	$SYS_open, R7
    61		SWI	$0
    62		MOVW	$0xfffff001, R1
    63		CMP	R1, R0
    64		MOVW.HI	$-1, R0
    65		MOVW	R0, ret+12(FP)
    66		RET
    67	
    68	TEXT runtime·closefd(SB),NOSPLIT,$0
    69		MOVW	fd+0(FP), R0
    70		MOVW	$SYS_close, R7
    71		SWI	$0
    72		MOVW	$0xfffff001, R1
    73		CMP	R1, R0
    74		MOVW.HI	$-1, R0
    75		MOVW	R0, ret+4(FP)
    76		RET
    77	
    78	TEXT runtime·write(SB),NOSPLIT,$0
    79		MOVW	fd+0(FP), R0
    80		MOVW	p+4(FP), R1
    81		MOVW	n+8(FP), R2
    82		MOVW	$SYS_write, R7
    83		SWI	$0
    84		MOVW	$0xfffff001, R1
    85		CMP	R1, R0
    86		MOVW.HI	$-1, R0
    87		MOVW	R0, ret+12(FP)
    88		RET
    89	
    90	TEXT runtime·read(SB),NOSPLIT,$0
    91		MOVW	fd+0(FP), R0
    92		MOVW	p+4(FP), R1
    93		MOVW	n+8(FP), R2
    94		MOVW	$SYS_read, R7
    95		SWI	$0
    96		MOVW	$0xfffff001, R1
    97		CMP	R1, R0
    98		MOVW.HI	$-1, R0
    99		MOVW	R0, ret+12(FP)
   100		RET
   101	
   102	TEXT runtime·exit(SB),NOSPLIT|NOFRAME,$0
   103		MOVW	code+0(FP), R0
   104		MOVW	$SYS_exit_group, R7
   105		SWI	$0
   106		MOVW	$1234, R0
   107		MOVW	$1002, R1
   108		MOVW	R0, (R1)	// fail hard
   109	
   110	TEXT exit1<>(SB),NOSPLIT|NOFRAME,$0
   111		MOVW	code+0(FP), R0
   112		MOVW	$SYS_exit, R7
   113		SWI	$0
   114		MOVW	$1234, R0
   115		MOVW	$1003, R1
   116		MOVW	R0, (R1)	// fail hard
   117	
   118	// func exitThread(wait *uint32)
   119	TEXT runtime·exitThread(SB),NOSPLIT|NOFRAME,$0-4
   120		MOVW	wait+0(FP), R0
   121		// We're done using the stack.
   122		// Alas, there's no reliable way to make this write atomic
   123		// without potentially using the stack. So it goes.
   124		MOVW	$0, R1
   125		MOVW	R1, (R0)
   126		MOVW	$0, R0	// exit code
   127		MOVW	$SYS_exit, R7
   128		SWI	$0
   129		MOVW	$1234, R0
   130		MOVW	$1004, R1
   131		MOVW	R0, (R1)	// fail hard
   132		JMP	0(PC)
   133	
   134	TEXT runtime·gettid(SB),NOSPLIT,$0-4
   135		MOVW	$SYS_gettid, R7
   136		SWI	$0
   137		MOVW	R0, ret+0(FP)
   138		RET
   139	
   140	TEXT	runtime·raise(SB),NOSPLIT|NOFRAME,$0
   141		MOVW	$SYS_gettid, R7
   142		SWI	$0
   143		// arg 1 tid already in R0 from gettid
   144		MOVW	sig+0(FP), R1	// arg 2 - signal
   145		MOVW	$SYS_tkill, R7
   146		SWI	$0
   147		RET
   148	
   149	TEXT	runtime·raiseproc(SB),NOSPLIT|NOFRAME,$0
   150		MOVW	$SYS_getpid, R7
   151		SWI	$0
   152		// arg 1 tid already in R0 from getpid
   153		MOVW	sig+0(FP), R1	// arg 2 - signal
   154		MOVW	$SYS_kill, R7
   155		SWI	$0
   156		RET
   157	
   158	TEXT runtime·mmap(SB),NOSPLIT,$0
   159		MOVW	addr+0(FP), R0
   160		MOVW	n+4(FP), R1
   161		MOVW	prot+8(FP), R2
   162		MOVW	flags+12(FP), R3
   163		MOVW	fd+16(FP), R4
   164		MOVW	off+20(FP), R5
   165		MOVW	$SYS_mmap2, R7
   166		SWI	$0
   167		MOVW	$0xfffff001, R6
   168		CMP		R6, R0
   169		MOVW	$0, R1
   170		RSB.HI	$0, R0
   171		MOVW.HI	R0, R1		// if error, put in R1
   172		MOVW.HI	$0, R0
   173		MOVW	R0, p+24(FP)
   174		MOVW	R1, err+28(FP)
   175		RET
   176	
   177	TEXT runtime·munmap(SB),NOSPLIT,$0
   178		MOVW	addr+0(FP), R0
   179		MOVW	n+4(FP), R1
   180		MOVW	$SYS_munmap, R7
   181		SWI	$0
   182		MOVW	$0xfffff001, R6
   183		CMP 	R6, R0
   184		MOVW.HI	$0, R8  // crash on syscall failure
   185		MOVW.HI	R8, (R8)
   186		RET
   187	
   188	TEXT runtime·madvise(SB),NOSPLIT,$0
   189		MOVW	addr+0(FP), R0
   190		MOVW	n+4(FP), R1
   191		MOVW	flags+8(FP), R2
   192		MOVW	$SYS_madvise, R7
   193		SWI	$0
   194		// ignore failure - maybe pages are locked
   195		RET
   196	
   197	TEXT runtime·setitimer(SB),NOSPLIT,$0
   198		MOVW	mode+0(FP), R0
   199		MOVW	new+4(FP), R1
   200		MOVW	old+8(FP), R2
   201		MOVW	$SYS_setitimer, R7
   202		SWI	$0
   203		RET
   204	
   205	TEXT runtime·mincore(SB),NOSPLIT,$0
   206		MOVW	addr+0(FP), R0
   207		MOVW	n+4(FP), R1
   208		MOVW	dst+8(FP), R2
   209		MOVW	$SYS_mincore, R7
   210		SWI	$0
   211		MOVW	R0, ret+12(FP)
   212		RET
   213	
   214	TEXT runtime·walltime(SB),NOSPLIT,$0-12
   215		// We don't know how much stack space the VDSO code will need,
   216		// so switch to g0.
   217	
   218		// Save old SP. Use R13 instead of SP to avoid linker rewriting the offsets.
   219		MOVW	R13, R4	// R4 is unchanged by C code.
   220	
   221		MOVW	g_m(g), R5 // R5 is unchanged by C code.
   222	
   223		// Set vdsoPC and vdsoSP for SIGPROF traceback.
   224		MOVW	LR, m_vdsoPC(R5)
   225		MOVW	R13, m_vdsoSP(R5)
   226	
   227		MOVW	m_curg(R5), R0
   228	
   229		CMP	g, R0		// Only switch if on curg.
   230		B.NE	noswitch
   231	
   232		MOVW	m_g0(R5), R0
   233		MOVW	(g_sched+gobuf_sp)(R0), R13	 // Set SP to g0 stack
   234	
   235	noswitch:
   236		SUB	$24, R13	// Space for results
   237		BIC	$0x7, R13	// Align for C code
   238	
   239		MOVW	$CLOCK_REALTIME, R0
   240		MOVW	$8(R13), R1	// timespec
   241		MOVW	runtime·vdsoClockgettimeSym(SB), R11
   242		CMP	$0, R11
   243		B.EQ	fallback
   244	
   245		BL	(R11)
   246		JMP	finish
   247	
   248	fallback:
   249		MOVW	$SYS_clock_gettime, R7
   250		SWI	$0
   251	
   252	finish:
   253		MOVW	8(R13), R0  // sec
   254		MOVW	12(R13), R2  // nsec
   255	
   256		MOVW	R4, R13		// Restore real SP
   257		MOVW	$0, R1
   258		MOVW	R1, m_vdsoSP(R5)
   259	
   260		MOVW	R0, sec_lo+0(FP)
   261		MOVW	R1, sec_hi+4(FP)
   262		MOVW	R2, nsec+8(FP)
   263		RET
   264	
   265	// int64 nanotime(void)
   266	TEXT runtime·nanotime(SB),NOSPLIT,$0-8
   267		// Switch to g0 stack. See comment above in runtime·walltime.
   268	
   269		// Save old SP. Use R13 instead of SP to avoid linker rewriting the offsets.
   270		MOVW	R13, R4	// R4 is unchanged by C code.
   271	
   272		MOVW	g_m(g), R5 // R5 is unchanged by C code.
   273	
   274		// Set vdsoPC and vdsoSP for SIGPROF traceback.
   275		MOVW	LR, m_vdsoPC(R5)
   276		MOVW	R13, m_vdsoSP(R5)
   277	
   278		MOVW	m_curg(R5), R0
   279	
   280		CMP	g, R0		// Only switch if on curg.
   281		B.NE	noswitch
   282	
   283		MOVW	m_g0(R5), R0
   284		MOVW	(g_sched+gobuf_sp)(R0), R13	// Set SP to g0 stack
   285	
   286	noswitch:
   287		SUB	$24, R13	// Space for results
   288		BIC	$0x7, R13	// Align for C code
   289	
   290		MOVW	$CLOCK_MONOTONIC, R0
   291		MOVW	$8(R13), R1	// timespec
   292		MOVW	runtime·vdsoClockgettimeSym(SB), R11
   293		CMP	$0, R11
   294		B.EQ	fallback
   295	
   296		BL	(R11)
   297		JMP	finish
   298	
   299	fallback:
   300		MOVW	$SYS_clock_gettime, R7
   301		SWI	$0
   302	
   303	finish:
   304		MOVW	8(R13), R0	// sec
   305		MOVW	12(R13), R2	// nsec
   306	
   307		MOVW	R4, R13		// Restore real SP
   308		MOVW	$0, R4
   309		MOVW	R4, m_vdsoSP(R5)
   310	
   311		MOVW	$1000000000, R3
   312		MULLU	R0, R3, (R1, R0)
   313		ADD.S	R2, R0
   314		ADC	R4, R1
   315	
   316		MOVW	R0, ret_lo+0(FP)
   317		MOVW	R1, ret_hi+4(FP)
   318		RET
   319	
   320	// int32 futex(int32 *uaddr, int32 op, int32 val,
   321	//	struct timespec *timeout, int32 *uaddr2, int32 val2);
   322	TEXT runtime·futex(SB),NOSPLIT,$0
   323		MOVW    addr+0(FP), R0
   324		MOVW    op+4(FP), R1
   325		MOVW    val+8(FP), R2
   326		MOVW    ts+12(FP), R3
   327		MOVW    addr2+16(FP), R4
   328		MOVW    val3+20(FP), R5
   329		MOVW	$SYS_futex, R7
   330		SWI	$0
   331		MOVW	R0, ret+24(FP)
   332		RET
   333	
   334	// int32 clone(int32 flags, void *stack, M *mp, G *gp, void (*fn)(void));
   335	TEXT runtime·clone(SB),NOSPLIT,$0
   336		MOVW	flags+0(FP), R0
   337		MOVW	stk+4(FP), R1
   338		MOVW	$0, R2	// parent tid ptr
   339		MOVW	$0, R3	// tls_val
   340		MOVW	$0, R4	// child tid ptr
   341		MOVW	$0, R5
   342	
   343		// Copy mp, gp, fn off parent stack for use by child.
   344		// TODO(kaib): figure out which registers are clobbered by clone and avoid stack copying
   345		MOVW	$-16(R1), R1
   346		MOVW	mp+8(FP), R6
   347		MOVW	R6, 0(R1)
   348		MOVW	gp+12(FP), R6
   349		MOVW	R6, 4(R1)
   350		MOVW	fn+16(FP), R6
   351		MOVW	R6, 8(R1)
   352		MOVW	$1234, R6
   353		MOVW	R6, 12(R1)
   354	
   355		MOVW	$SYS_clone, R7
   356		SWI	$0
   357	
   358		// In parent, return.
   359		CMP	$0, R0
   360		BEQ	3(PC)
   361		MOVW	R0, ret+20(FP)
   362		RET
   363	
   364		// Paranoia: check that SP is as we expect. Use R13 to avoid linker 'fixup'
   365		MOVW	12(R13), R0
   366		MOVW	$1234, R1
   367		CMP	R0, R1
   368		BEQ	2(PC)
   369		BL	runtime·abort(SB)
   370	
   371		MOVW	0(R13), R8    // m
   372		MOVW	4(R13), R0    // g
   373	
   374		CMP	$0, R8
   375		BEQ	nog
   376		CMP	$0, R0
   377		BEQ	nog
   378	
   379		MOVW	R0, g
   380		MOVW	R8, g_m(g)
   381	
   382		// paranoia; check they are not nil
   383		MOVW	0(R8), R0
   384		MOVW	0(g), R0
   385	
   386		BL	runtime·emptyfunc(SB)	// fault if stack check is wrong
   387	
   388		// Initialize m->procid to Linux tid
   389		MOVW	$SYS_gettid, R7
   390		SWI	$0
   391		MOVW	g_m(g), R8
   392		MOVW	R0, m_procid(R8)
   393	
   394	nog:
   395		// Call fn
   396		MOVW	8(R13), R0
   397		MOVW	$16(R13), R13
   398		BL	(R0)
   399	
   400		// It shouldn't return. If it does, exit that thread.
   401		SUB	$16, R13 // restore the stack pointer to avoid memory corruption
   402		MOVW	$0, R0
   403		MOVW	R0, 4(R13)
   404		BL	exit1<>(SB)
   405	
   406		MOVW	$1234, R0
   407		MOVW	$1005, R1
   408		MOVW	R0, (R1)
   409	
   410	TEXT runtime·sigaltstack(SB),NOSPLIT,$0
   411		MOVW	new+0(FP), R0
   412		MOVW	old+4(FP), R1
   413		MOVW	$SYS_sigaltstack, R7
   414		SWI	$0
   415		MOVW	$0xfffff001, R6
   416		CMP 	R6, R0
   417		MOVW.HI	$0, R8  // crash on syscall failure
   418		MOVW.HI	R8, (R8)
   419		RET
   420	
   421	TEXT runtime·sigfwd(SB),NOSPLIT,$0-16
   422		MOVW	sig+4(FP), R0
   423		MOVW	info+8(FP), R1
   424		MOVW	ctx+12(FP), R2
   425		MOVW	fn+0(FP), R11
   426		MOVW	R13, R4
   427		SUB	$24, R13
   428		BIC	$0x7, R13 // alignment for ELF ABI
   429		BL	(R11)
   430		MOVW	R4, R13
   431		RET
   432	
   433	TEXT runtime·sigtramp(SB),NOSPLIT,$12
   434		// this might be called in external code context,
   435		// where g is not set.
   436		// first save R0, because runtime·load_g will clobber it
   437		MOVW	R0, 4(R13)
   438		MOVB	runtime·iscgo(SB), R0
   439		CMP 	$0, R0
   440		BL.NE	runtime·load_g(SB)
   441	
   442		MOVW	R1, 8(R13)
   443		MOVW	R2, 12(R13)
   444		MOVW  	$runtime·sigtrampgo(SB), R11
   445		BL	(R11)
   446		RET
   447	
   448	TEXT runtime·cgoSigtramp(SB),NOSPLIT,$0
   449		MOVW  	$runtime·sigtramp(SB), R11
   450		B	(R11)
   451	
   452	TEXT runtime·rtsigprocmask(SB),NOSPLIT,$0
   453		MOVW	how+0(FP), R0
   454		MOVW	new+4(FP), R1
   455		MOVW	old+8(FP), R2
   456		MOVW	size+12(FP), R3
   457		MOVW	$SYS_rt_sigprocmask, R7
   458		SWI	$0
   459		RET
   460	
   461	TEXT runtime·rt_sigaction(SB),NOSPLIT,$0
   462		MOVW	sig+0(FP), R0
   463		MOVW	new+4(FP), R1
   464		MOVW	old+8(FP), R2
   465		MOVW	size+12(FP), R3
   466		MOVW	$SYS_rt_sigaction, R7
   467		SWI	$0
   468		MOVW	R0, ret+16(FP)
   469		RET
   470	
   471	TEXT runtime·usleep(SB),NOSPLIT,$12
   472		MOVW	usec+0(FP), R0
   473		CALL	runtime·usplitR0(SB)
   474		MOVW	R0, 4(R13)
   475		MOVW	$1000, R0	// usec to nsec
   476		MUL	R0, R1
   477		MOVW	R1, 8(R13)
   478		MOVW	$4(R13), R0
   479		MOVW	$0, R1
   480		MOVW	$SYS_nanosleep, R7
   481		SWI	$0
   482		RET
   483	
   484	// As for cas, memory barriers are complicated on ARM, but the kernel
   485	// provides a user helper. ARMv5 does not support SMP and has no
   486	// memory barrier instruction at all. ARMv6 added SMP support and has
   487	// a memory barrier, but it requires writing to a coprocessor
   488	// register. ARMv7 introduced the DMB instruction, but it's expensive
   489	// even on single-core devices. The kernel helper takes care of all of
   490	// this for us.
   491	
   492	TEXT kernelPublicationBarrier<>(SB),NOSPLIT,$0
   493		// void __kuser_memory_barrier(void);
   494		MOVW	$0xffff0fa0, R11
   495		CALL	(R11)
   496		RET
   497	
   498	TEXT ·publicationBarrier(SB),NOSPLIT,$0
   499		MOVB	·goarm(SB), R11
   500		CMP	$7, R11
   501		BLT	2(PC)
   502		JMP	·armPublicationBarrier(SB)
   503		JMP	kernelPublicationBarrier<>(SB) // extra layer so this function is leaf and no SP adjustment on GOARM=7
   504	
   505	TEXT runtime·osyield(SB),NOSPLIT,$0
   506		MOVW	$SYS_sched_yield, R7
   507		SWI	$0
   508		RET
   509	
   510	TEXT runtime·sched_getaffinity(SB),NOSPLIT,$0
   511		MOVW	pid+0(FP), R0
   512		MOVW	len+4(FP), R1
   513		MOVW	buf+8(FP), R2
   514		MOVW	$SYS_sched_getaffinity, R7
   515		SWI	$0
   516		MOVW	R0, ret+12(FP)
   517		RET
   518	
   519	// int32 runtime·epollcreate(int32 size)
   520	TEXT runtime·epollcreate(SB),NOSPLIT,$0
   521		MOVW	size+0(FP), R0
   522		MOVW	$SYS_epoll_create, R7
   523		SWI	$0
   524		MOVW	R0, ret+4(FP)
   525		RET
   526	
   527	// int32 runtime·epollcreate1(int32 flags)
   528	TEXT runtime·epollcreate1(SB),NOSPLIT,$0
   529		MOVW	flags+0(FP), R0
   530		MOVW	$SYS_epoll_create1, R7
   531		SWI	$0
   532		MOVW	R0, ret+4(FP)
   533		RET
   534	
   535	// func epollctl(epfd, op, fd int32, ev *epollEvent) int
   536	TEXT runtime·epollctl(SB),NOSPLIT,$0
   537		MOVW	epfd+0(FP), R0
   538		MOVW	op+4(FP), R1
   539		MOVW	fd+8(FP), R2
   540		MOVW	ev+12(FP), R3
   541		MOVW	$SYS_epoll_ctl, R7
   542		SWI	$0
   543		MOVW	R0, ret+16(FP)
   544		RET
   545	
   546	// int32 runtime·epollwait(int32 epfd, EpollEvent *ev, int32 nev, int32 timeout)
   547	TEXT runtime·epollwait(SB),NOSPLIT,$0
   548		MOVW	epfd+0(FP), R0
   549		MOVW	ev+4(FP), R1
   550		MOVW	nev+8(FP), R2
   551		MOVW	timeout+12(FP), R3
   552		MOVW	$SYS_epoll_wait, R7
   553		SWI	$0
   554		MOVW	R0, ret+16(FP)
   555		RET
   556	
   557	// void runtime·closeonexec(int32 fd)
   558	TEXT runtime·closeonexec(SB),NOSPLIT,$0
   559		MOVW	fd+0(FP), R0	// fd
   560		MOVW	$2, R1	// F_SETFD
   561		MOVW	$1, R2	// FD_CLOEXEC
   562		MOVW	$SYS_fcntl, R7
   563		SWI	$0
   564		RET
   565	
   566	// b __kuser_get_tls @ 0xffff0fe0
   567	TEXT runtime·read_tls_fallback(SB),NOSPLIT|NOFRAME,$0
   568		MOVW	$0xffff0fe0, R0
   569		B	(R0)
   570	
   571	TEXT runtime·access(SB),NOSPLIT,$0
   572		MOVW	name+0(FP), R0
   573		MOVW	mode+4(FP), R1
   574		MOVW	$SYS_access, R7
   575		SWI	$0
   576		MOVW	R0, ret+8(FP)
   577		RET
   578	
   579	TEXT runtime·connect(SB),NOSPLIT,$0
   580		MOVW	fd+0(FP), R0
   581		MOVW	addr+4(FP), R1
   582		MOVW	len+8(FP), R2
   583		MOVW	$SYS_connect, R7
   584		SWI	$0
   585		MOVW	R0, ret+12(FP)
   586		RET
   587	
   588	TEXT runtime·socket(SB),NOSPLIT,$0
   589		MOVW	domain+0(FP), R0
   590		MOVW	typ+4(FP), R1
   591		MOVW	prot+8(FP), R2
   592		MOVW	$SYS_socket, R7
   593		SWI	$0
   594		MOVW	R0, ret+12(FP)
   595		RET
   596	
   597	// func sbrk0() uintptr
   598	TEXT runtime·sbrk0(SB),NOSPLIT,$0-4
   599		// Implemented as brk(NULL).
   600		MOVW	$0, R0
   601		MOVW	$SYS_brk, R7
   602		SWI	$0
   603		MOVW	R0, ret+0(FP)
   604		RET

View as plain text