1*b7b6a059Schristos /* $NetBSD: h_raw.c,v 1.6 2011/07/24 14:00:36 christos Exp $ */
233a7866dSplunky
333a7866dSplunky /*
433a7866dSplunky * Copyright (c) 2011 The NetBSD Foundation, Inc.
533a7866dSplunky * All rights reserved.
633a7866dSplunky *
733a7866dSplunky * Redistribution and use in source and binary forms, with or without
833a7866dSplunky * modification, are permitted provided that the following conditions
933a7866dSplunky * are met:
1033a7866dSplunky * 1. Redistributions of source code must retain the above copyright
1133a7866dSplunky * notice, this list of conditions and the following disclaimer.
1233a7866dSplunky * 2. Redistributions in binary form must reproduce the above copyright
1333a7866dSplunky * notice, this list of conditions and the following disclaimer in the
1433a7866dSplunky * documentation and/or other materials provided with the distribution.
1533a7866dSplunky *
1633a7866dSplunky * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
1733a7866dSplunky * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
1833a7866dSplunky * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
1933a7866dSplunky * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
2033a7866dSplunky * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2133a7866dSplunky * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2233a7866dSplunky * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2333a7866dSplunky * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2433a7866dSplunky * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2533a7866dSplunky * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2633a7866dSplunky * POSSIBILITY OF SUCH DAMAGE.
2733a7866dSplunky */
2833a7866dSplunky
2933a7866dSplunky #include <sys/cdefs.h>
3033a7866dSplunky __COPYRIGHT("@(#) Copyright (c) 2011\
3133a7866dSplunky The NetBSD Foundation, inc. All rights reserved.");
32*b7b6a059Schristos __RCSID("$NetBSD: h_raw.c,v 1.6 2011/07/24 14:00:36 christos Exp $");
3333a7866dSplunky
3404bb4b52Smartin #include <stdio.h>
3533a7866dSplunky #include <stdlib.h>
3633a7866dSplunky
37e19d93dcSplunky void poke(int *, size_t);
38e19d93dcSplunky
39e19d93dcSplunky void
poke(int * b,size_t index)40e19d93dcSplunky poke(int *b, size_t index)
4133a7866dSplunky {
4204bb4b52Smartin size_t i;
43*b7b6a059Schristos volatile int sum = 0;
4404bb4b52Smartin
45e19d93dcSplunky b[index] = 42;
4604bb4b52Smartin for (i = 0; i < 10; i++)
4704bb4b52Smartin sum += b[i];
4833a7866dSplunky }
4933a7866dSplunky
5033a7866dSplunky int
main(int argc,char * argv[])5133a7866dSplunky main(int argc, char *argv[])
5233a7866dSplunky {
53e19d93dcSplunky int b[10];
5433a7866dSplunky
5533a7866dSplunky poke(b, atoi(argv[1]));
5633a7866dSplunky return 0;
5733a7866dSplunky }
58