1 |
786 |
skrzyp |
//==========================================================================
|
2 |
|
|
//
|
3 |
|
|
// ./net/http/current/tests/httpd1.c
|
4 |
|
|
//
|
5 |
|
|
//
|
6 |
|
|
//==========================================================================
|
7 |
|
|
// ####ECOSGPLCOPYRIGHTBEGIN####
|
8 |
|
|
// -------------------------------------------
|
9 |
|
|
// This file is part of eCos, the Embedded Configurable Operating System.
|
10 |
|
|
// Copyright (C) 2003 Free Software Foundation, Inc.
|
11 |
|
|
//
|
12 |
|
|
// eCos is free software; you can redistribute it and/or modify it under
|
13 |
|
|
// the terms of the GNU General Public License as published by the Free
|
14 |
|
|
// Software Foundation; either version 2 or (at your option) any later
|
15 |
|
|
// version.
|
16 |
|
|
//
|
17 |
|
|
// eCos is distributed in the hope that it will be useful, but WITHOUT
|
18 |
|
|
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
19 |
|
|
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
20 |
|
|
// for more details.
|
21 |
|
|
//
|
22 |
|
|
// You should have received a copy of the GNU General Public License
|
23 |
|
|
// along with eCos; if not, write to the Free Software Foundation, Inc.,
|
24 |
|
|
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
25 |
|
|
//
|
26 |
|
|
// As a special exception, if other files instantiate templates or use
|
27 |
|
|
// macros or inline functions from this file, or you compile this file
|
28 |
|
|
// and link it with other works to produce a work based on this file,
|
29 |
|
|
// this file does not by itself cause the resulting work to be covered by
|
30 |
|
|
// the GNU General Public License. However the source code for this file
|
31 |
|
|
// must still be made available in accordance with section (3) of the GNU
|
32 |
|
|
// General Public License v2.
|
33 |
|
|
//
|
34 |
|
|
// This exception does not invalidate any other reasons why a work based
|
35 |
|
|
// on this file might be covered by the GNU General Public License.
|
36 |
|
|
// -------------------------------------------
|
37 |
|
|
// ####ECOSGPLCOPYRIGHTEND####
|
38 |
|
|
//==========================================================================
|
39 |
|
|
//#####DESCRIPTIONBEGIN####
|
40 |
|
|
//
|
41 |
|
|
// Author(s): andrew.lunn@ascom.ch
|
42 |
|
|
// Contributors: andrew.lunn@ascom.ch
|
43 |
|
|
// Date: 2003-04-29
|
44 |
|
|
// Purpose:
|
45 |
|
|
// Description:
|
46 |
|
|
//
|
47 |
|
|
//
|
48 |
|
|
//####DESCRIPTIONEND####
|
49 |
|
|
//
|
50 |
|
|
//==========================================================================
|
51 |
|
|
|
52 |
|
|
#include <network.h>
|
53 |
|
|
#include <cyg/infra/testcase.h>
|
54 |
|
|
|
55 |
|
|
#define STACK_SIZE (CYGNUM_HAL_STACK_SIZE_TYPICAL + 0x1000)
|
56 |
|
|
static char stack[STACK_SIZE];
|
57 |
|
|
static cyg_thread thread_data;
|
58 |
|
|
static cyg_handle_t thread_handle;
|
59 |
|
|
|
60 |
|
|
void
|
61 |
|
|
httpd_test(cyg_addrword_t p)
|
62 |
|
|
{
|
63 |
|
|
|
64 |
|
|
CYG_TEST_INIT();
|
65 |
|
|
|
66 |
|
|
init_all_network_interfaces();
|
67 |
|
|
|
68 |
|
|
cyg_thread_delay(1 * 60 * 100);
|
69 |
|
|
|
70 |
|
|
CYG_TEST_PASS_FINISH( "httpd test finished" );
|
71 |
|
|
}
|
72 |
|
|
|
73 |
|
|
void
|
74 |
|
|
cyg_start(void)
|
75 |
|
|
{
|
76 |
|
|
// Create a main thread, so we can run the scheduler and have time 'pass'
|
77 |
|
|
cyg_thread_create(10, // Priority - just a number
|
78 |
|
|
httpd_test, // entry
|
79 |
|
|
0, // entry parameter
|
80 |
|
|
"httpd test", // Name
|
81 |
|
|
&stack[0], // Stack
|
82 |
|
|
STACK_SIZE, // Size
|
83 |
|
|
&thread_handle, // Handle
|
84 |
|
|
&thread_data // Thread data structure
|
85 |
|
|
);
|
86 |
|
|
cyg_thread_resume(thread_handle); // Start it
|
87 |
|
|
cyg_scheduler_start();
|
88 |
|
|
}
|