All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bruno Ducrot <ducrot-kk6yZipjEM5g9hUCZPvPmw@public.gmane.org>
To: Janosch Machowinski <scotch-cGBD8117FJM@public.gmane.org>
Cc: linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: Strange interpreter behaviour
Date: Tue, 17 Jan 2006 16:47:42 +0100	[thread overview]
Message-ID: <20060117154742.GD2154@poupinou.org> (raw)
In-Reply-To: <43CCFF1C.4000309-cGBD8117FJM@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 355 bytes --]

On Tue, Jan 17, 2006 at 03:28:44PM +0100, Janosch Machowinski wrote:
> >
> >Ok.  Well maybe that little tool attached could give us the
> >information.
> >
> Nope, scotchmobil pmtools # ./a.out
> read: Bad address

Sometimes I'm stupid.  Try this version instead.


-- 
Bruno Ducrot

--  Which is worse:  ignorance or apathy?
--  Don't know.  Don't care.

[-- Attachment #2: check_io2b.c --]
[-- Type: text/x-csrc, Size: 895 bytes --]

#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>


int main(void)
{
	int fd;
	off_t c;
	unsigned char *p;

	fd = open("/dev/mem", O_RDONLY);
	if (fd < 0) {
		perror("open /dev/mem");
		exit(1);
	}

	/*
	 * SS1,    1,	<- 0
	 * SS2,    1,
	 * SS3,    1,
	 * SS4,    1,
	 * Offset (0x01),
	 * IOST,   16,	<-   1, 2
	 * SPIO,   16,	<-   3, 4
	 * PMBS,   16,	<-   5, 6
	 * PMLN,   8,	<-   7
	 * SMBS,   16,	<-   8, 9
	 * SMLN,   8,	<-   A
	 * IO1B,   16,	<-   B, C
	 * IO1L,   8,	<-   D
	 * IO2B,   16,	<-   E, F
	 * IO2L,   8,
	 * TOPM,   32,
	 * ROMS,   32,
	 */

	p = mmap(NULL, 1024, PROT_READ, MAP_SHARED, fd, 0x1FF50000);
	if (p == MAP_FAILED) {
		perror("mmap");
		exit(1);
	}
	close(fd);
	printf("0x%x\n", ((p[0x64 + 0xf] & 0xff) << 8) | (p[0x64 + 0xe] & 0xff));
	munmap(p, 1024);

	return 0;
}

  parent reply	other threads:[~2006-01-17 15:47 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-07 17:18 Strange interpreter behaviour Janosch Machowinski
     [not found] ` <43BFF7DE.1000909-cGBD8117FJM@public.gmane.org>
2006-01-16 17:19   ` Bruno Ducrot
     [not found]     ` <20060116171932.GF25115-kk6yZipjEM5g9hUCZPvPmw@public.gmane.org>
2006-01-16 21:27       ` Janosch Machowinski
     [not found]         ` <43CC0FC0.9090806-cGBD8117FJM@public.gmane.org>
2006-01-17 10:30           ` Bruno Ducrot
     [not found]             ` <20060117103043.GA2154-kk6yZipjEM5g9hUCZPvPmw@public.gmane.org>
2006-01-17 12:41               ` Janosch Machowinski
     [not found]                 ` <43CCE603.3010600-cGBD8117FJM@public.gmane.org>
2006-01-17 13:24                   ` Bruno Ducrot
     [not found]                     ` <20060117132435.GB2154-kk6yZipjEM5g9hUCZPvPmw@public.gmane.org>
2006-01-17 14:28                       ` Janosch Machowinski
     [not found]                         ` <43CCFF1C.4000309-cGBD8117FJM@public.gmane.org>
2006-01-17 15:47                           ` Bruno Ducrot [this message]
2006-01-20 15:27                             ` Janosch Machowinski
2006-01-20 19:32                               ` Bruno Ducrot
2006-01-21 18:55                                 ` Janosch Machowinski
  -- strict thread matches above, loose matches on Subject: below --
2006-01-09  5:58 Yu, Luming
2006-01-09  7:16 ` Janosch Machowinski
2006-01-16  2:27 Yu, Luming
2006-01-16 19:22 ` Janosch Machowinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060117154742.GD2154@poupinou.org \
    --to=ducrot-kk6yzipjem5g9huczpvpmw@public.gmane.org \
    --cc=linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=scotch-cGBD8117FJM@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.