[BACK]Return to vcs_hook.c CVS log [TXT][DIR] Up to [Development] / linux-2.6-xfs / arch / cris / arch-v32 / kernel

File: [Development] / linux-2.6-xfs / arch / cris / arch-v32 / kernel / Attic / vcs_hook.c (download)

Revision 1.13, Wed Sep 12 17:09:56 2007 UTC (10 years, 1 month ago) by tes.longdrop.melbourne.sgi.com
Branch: MAIN
Changes since 1.12: +0 -0 lines

Update 2.6.x-xfs to 2.6.23-rc4.

Also update fs/xfs with external mainline changes.
There were 12 such missing commits that I detected:

--------
commit ad690ef9e690f6c31f7d310b09ef1314bcec9033
Author: Al Viro <viro@ftp.linux.org.uk>
    xfs ioctl __user annotations

commit 20c2df83d25c6a95affe6157a4c9cac4cf5ffaac
Author: Paul Mundt <lethal@linux-sh.org>
    mm: Remove slab destructors from kmem_cache_create().

commit d0217ac04ca6591841e5665f518e38064f4e65bd
Author: Nick Piggin <npiggin@suse.de>
    mm: fault feedback #1

commit 54cb8821de07f2ffcd28c380ce9b93d5784b40d7
Author: Nick Piggin <npiggin@suse.de>
    mm: merge populate and nopage into fault (fixes nonlinear)

commit d00806b183152af6d24f46f0c33f14162ca1262a
Author: Nick Piggin <npiggin@suse.de>
    mm: fix fault vs invalidate race for linear mappings

commit a569425512253992cc64ebf8b6d00a62f986db3e
Author: Christoph Hellwig <hch@infradead.org>
    knfsd: exportfs: add exportfs.h header

commit 831441862956fffa17b9801db37e6ea1650b0f69
Author: Rafael J. Wysocki <rjw@sisk.pl>
    Freezer: make kernel threads nonfreezable by default

commit 8e1f936b73150f5095448a0fee6d4f30a1f9001d
Author: Rusty Russell <rusty@rustcorp.com.au>
    mm: clean up and kernelify shrinker registration

commit 5ffc4ef45b3b0a57872f631b4e4ceb8ace0d7496
Author: Jens Axboe <jens.axboe@oracle.com>
    sendfile: remove .sendfile from filesystems that use generic_file_sendfile()

commit 8bb7844286fb8c9fce6f65d8288aeb09d03a5e0d
Author: Rafael J. Wysocki <rjw@sisk.pl>
    Add suspend-related notifications for CPU hotplug

commit 59c51591a0ac7568824f541f57de967e88adaa07
Author: Michael Opdenacker <michael@free-electrons.com>
    Fix occurrences of "the the "

commit 0ceb331433e8aad9c5f441a965d7c681f8b9046f
Author: Dmitriy Monakhov <dmonakhov@openvz.org>
    mm: move common segment checks to separate helper function
--------
Merge of 2.6.x-xfs-melb:linux:29656b by kenmcd.

// $Id: vcs_hook.c,v 1.13 2007/09/12 17:09:56 tes.longdrop.melbourne.sgi.com Exp $
//
// Call simulator hook. This is the part running in the
// simulated program.
//

#include "vcs_hook.h"
#include <stdarg.h>
#include <asm/arch-v32/hwregs/reg_map.h>
#include <asm/arch-v32/hwregs/intr_vect_defs.h>

#define HOOK_TRIG_ADDR     0xb7000000   /* hook cvlog model reg address */
#define HOOK_MEM_BASE_ADDR 0xa0000000   /* csp4 (shared mem) base addr */

#define HOOK_DATA(offset) ((unsigned*) HOOK_MEM_BASE_ADDR)[offset]
#define VHOOK_DATA(offset) ((volatile unsigned*) HOOK_MEM_BASE_ADDR)[offset]
#define HOOK_TRIG(funcid) do { *((unsigned *) HOOK_TRIG_ADDR) = funcid; } while(0)
#define HOOK_DATA_BYTE(offset) ((unsigned char*) HOOK_MEM_BASE_ADDR)[offset]


// ------------------------------------------------------------------ hook_call
int hook_call( unsigned id, unsigned pcnt, ...) {
  va_list ap;
  unsigned i;
  unsigned ret;
#ifdef USING_SOS
  PREEMPT_OFF_SAVE();
#endif

  // pass parameters
  HOOK_DATA(0) = id;

  /* Have to make hook_print_str a special case since we call with a
     parameter of byte type. Should perhaps be a separate
     hook_call. */

  if (id == hook_print_str) {
    int i;
    char *str;

    HOOK_DATA(1) = pcnt;

    va_start(ap, pcnt);
    str = (char*)va_arg(ap,unsigned);

    for (i=0; i!=pcnt; i++) {
      HOOK_DATA_BYTE(8+i) = str[i];
    }
    HOOK_DATA_BYTE(8+i) = 0;	/* null byte */
  }
  else {
    va_start(ap, pcnt);
    for( i = 1; i <= pcnt; i++ ) HOOK_DATA(i) = va_arg(ap,unsigned);
    va_end(ap);
  }

  // read from mem to make sure data has propagated to memory before trigging
  *((volatile unsigned*) HOOK_MEM_BASE_ADDR);

  // trigger hook
  HOOK_TRIG(id);

  // wait for call to finish
  while( VHOOK_DATA(0) > 0 ) {}

  // extract return value

  ret = VHOOK_DATA(1);

#ifdef USING_SOS
  PREEMPT_RESTORE();
#endif
  return ret;
}

unsigned
hook_buf(unsigned i)
{
  return (HOOK_DATA(i));
}

void print_str( const char *str ) {
  int i;
  for (i=1; str[i]; i++);         /* find null at end of string */
  hook_call(hook_print_str, i, str);
}

// --------------------------------------------------------------- CPU_KICK_DOG
void CPU_KICK_DOG(void) {
  (void) hook_call( hook_kick_dog, 0 );
}

// ------------------------------------------------------- CPU_WATCHDOG_TIMEOUT
void CPU_WATCHDOG_TIMEOUT( unsigned t ) {
  (void) hook_call( hook_dog_timeout, 1, t );
}