Path: blob/master/arch/mn10300/kernel/profile-low.S
10817 views
###############################################################################1#2# Fast profiling interrupt handler3#4# Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.5# Written by David Howells ([email protected])6#7# This program is free software; you can redistribute it and/or8# modify it under the terms of the GNU General Public Licence9# as published by the Free Software Foundation; either version10# 2 of the Licence, or (at your option) any later version.11#12###############################################################################13#include <linux/sys.h>14#include <linux/linkage.h>15#include <asm/segment.h>16#include <asm/smp.h>17#include <asm/intctl-regs.h>18#include <asm/timer-regs.h>1920#define pi break2122.balign 423counter:24.long -12526###############################################################################27#28# Profiling interrupt entry point29# - intended to run at interrupt priority 130#31###############################################################################32ENTRY(profile_handler)33movm [d2,d3,a2],(sp)3435# ignore userspace36mov (12,sp),d237and EPSW_nSL,d238bne out3940# do nothing if there's no buffer41mov (prof_buffer),a242and a2,a243beq out44or 0x20000000,a24546# calculate relative position in text segment47mov (16,sp),d248sub _stext,d249mov (prof_shift),d350lsr d3,d251mov (prof_len),d352cmp d3,d253bcc outside_text5455# increment the appropriate profile bucket56do_inc:57asl2 d258mov (a2,d2),d359inc d360mov d3,(a2,d2)61out:62mov GxICR_DETECT,d263movbu d2,(TM11ICR) # ACK the interrupt64movbu (TM11ICR),d265movm (sp),[d2,d3,a2]66rti6768outside_text:69sub 1,d370mov d3,d271bra do_inc727374